如何获取数据集值 [英] How to get dataset value

查看:132
本文介绍了如何获取数据集值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

protected void butSubmit_Click(object sender,EventArgs e)

{

if(txtClientContactemailid.Text!=&& txtClientcontactname.Text!= )

{

ClientContactPersonBO obj = new ClientContactPersonBO();

DataSet ds = new DataSet();

obj.Email = txtClientContactemailid.Text;

ds = obj.CheckClientExist();



if(ds.Tables.Count> 0 && ds.Tables [0] .Rows.Count> 0)

{



lblerror.Attributes.Remove(风格);

lblerror.Attributes.Add(style,display:block; color:red);

}



}



我的尝试:



ds.Tables [0] .Rows.count> 0显示count = 0

解决案
DS是否已在事只有你能弄清楚,因为我们没有访问您的代码或你的机器来运行该表中没有行。但是,要跟踪它,您需要查看obj.CheckClientExist(),因为这似乎是在填充ds DataSet对象。


protected void butSubmit_Click(object sender, EventArgs e)
{
if (txtClientContactemailid.Text != "" && txtClientcontactname.Text != "")
{
ClientContactPersonBO obj = new ClientContactPersonBO();
DataSet ds = new DataSet();
obj.Email = txtClientContactemailid.Text;
ds = obj.CheckClientExist();

if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
{

lblerror.Attributes.Remove("style");
lblerror.Attributes.Add("style", "display:block; color:red");
}

}

What I have tried:

ds.Tables[0].Rows.count>0 showing count=0

解决方案

If ds has no rows in the table that is something only you can figure out because we do not have access to your code or your machine to run this. However, to track it down you'll need to look at obj.CheckClientExist() since that is what appears to be filling in your ds DataSet object.


这篇关于如何获取数据集值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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