DataTable dtSQL = new DataTable();
SqlDataAdapter sda = new SqlDataAdapter(cmd);
sda.Fill(dtSQL);
foreach (dtSql.Rows r in dtSQL)
{
if (r.Columns["PreId"] == preID)
{
this.TextBox1.Text = "";
this.Label1.Text = "abc"; }
}foreach()里报错
SqlDataAdapter sda = new SqlDataAdapter(cmd);
sda.Fill(dtSQL);
foreach (dtSql.Rows r in dtSQL)
{
if (r.Columns["PreId"] == preID)
{
this.TextBox1.Text = "";
this.Label1.Text = "abc"; }
}foreach()里报错
解决方案 »
- WEB FORM如何实现扫描功能呢?
- ASP.NET 中DATALIST分页打印的问题,新手求助!
- 有没有大侠用过IEWord这个控件呀?请问在asp.net中如何使用,能提供点示例吗?
- [JS Cookie相关]希望高手能指点下错误,或给点思路吧。谢谢各位,顶有分
- 制作安装程序!!!!!!!!特着急。各位大侠帮帮忙
- Server.MapPath()的问题?
- 呕心盼正则表达式生成工具Regulator
- .net 2005 的GridView 如何取得当前选中行的数据?
- 是不是微软的漏洞: 我用JS代码在组合框中新增一个项,并选择, 但是发现后台程式中读取不到新加入的值? 大家是如何解决的? 谢谢!!!
- 一个MultiPage控件的问题?
- 伪静态问题。帮帮忙啊。。。
- asp.net 按下button后总是要重新加载页面,怎样避免?
{
if (r["PreId"] == preID)
{
this.TextBox1.Text = "";
this.Label1.Text = "abc"; }
}
{
if (object.Equals(r.Columns["PreId"],preID))
{
this.TextBox1.Text = "";
this.Label1.Text = "abc";
break;
}
}
{
if (object.Equals(r.Columns["PreId"],preID))
{
this.TextBox1.Text = "";
this.Label1.Text = "abc";
break;
}
}
{
if (object.Equals(r.Columns["PreId"],preID))
{
this.TextBox1.Text = "";
this.Label1.Text = "abc";
break;
}
}Columns 报错
DataTable dtSQL = new DataTable();
SqlDataAdapter sda = new SqlDataAdapter(cmd);
sda.Fill(dtSQL);
foreach (DataRow r in dtSQL.Rows)
{
if ((string)r["PreId"] == preID)
{
this.TextBox1.Text = "";
this.Label1.Text = "abc"; }
}