查询asp.net编码 [英] Query about asp.net coding

查看:69
本文介绍了查询asp.net编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.net中下面的编码是什么意思.

what is the meaning of below coding in .net.

 protected void Button1_Click(object sender, EventArgs e)
 {
    DataSet ds = HMSClass.get_EquiMaster();
    if(ds.Tables[0].Rows.Count>0)
    {
     for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
      {
        Eqcode = ds.Tables[0].Rows[i][1].ToString();

        if (Eqcode == txtEqCode.Text)
         {
           lbleqcode.Visible = true;
           eq=Eqcode;
           txtEqCode.Focus();
         }

      }
    }
}

推荐答案

1.调用函数并分配给数据集ds.
2.检查数据集是否为空,以便对数据集进行计数.
3.如果条件满足,则进行循环.
4.在循环内部,将值分配给字符串"Eqcode".
5.if循环比较字符串和Textbox值.
6.如果条件满足,则将标签"lbleqcode"设置为true.
7.再次将字符串值"eqcode"分配给另一个字符串变量"eq".
8.最后将焦点放在文本框"txtEqcode"上.
1.Calling the function and assigned into dataset ds.
2.check the dataset is empty, So for take the count for the dataset.
3.if condition satisfies then go for loop.
4.Inside the loop assigning the value into String "Eqcode".
5.if loop compare the string and the Textbox value.
6.If condition satisfies, visible the Label "lbleqcode" set as true.
7.Again assigning the String value "eqcode" into another string variable "eq".
8.Finally focus into Textbox "txtEqcode".


亲爱的开发者
.NET具有调试的良好功能,请使用它.这是您的代码的分步指南.检查此如何调试.NET代码 [
Dear developer
.NET has good facility of Debug, use it. it is step-by-step guide for your code. check this How to debug .NET code[^].

Anyways, from now onwords try to debug the code, if you have any problem we are here to solve.

here is your answer :

- code has function get_EquiMaster(); defined in HMSClass
class. function returns dataset.
- Check if dataset has records
- if it has records, then loop through all records.
- collect rows wise first column value
- compare this value against texbox value named txtEqCode
- Make lbleqcode lable visible and set focus to textbox


1.数据集收集从get_EquiMaster()函数返回的值.该值在HMSClass类中定义.

2.检查数据集是否包含值(ds.Tables [0] .Rows.Count大于0)

3.如果为True,则输入for循环,从每行的数据集表列中获取Eqcode

4.如果Eqcode和您的文本框"值相同,请采取一些措施.



谢谢
1. the dataset collects tne value which return from get_EquiMaster() function.which is defined in HMSClass class.

2. check the dataset contain value or not (ds.Tables[0].Rows.Count greater than 0)

3. if True then enter in for loop get the Eqcode from dataset table column of each row

4. if Eqcode and your Textbox value are same then take some action.



thanks


这篇关于查询asp.net编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆