如何获取数据集值 [英] How to get dataset value
问题描述
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屋!