for(int j=0;j<HDS.Tables["T_hppcustomertype"].Rows.Count;j++)
{
String RowT=HDS.Tables["T_hppcustomertype"].Rows[j]["customerid"].ToString();
DataRow[] RowM = HDS.Tables["T_hppcustomertype"].Select(RowT+"="+Cuid);
foreach (DataRow dr in RowM)
{
dr.Delete();
dr.EndEdit();
}
HDS.AcceptChanges();
}
请问为什么上面这段代码不能完成删除RowT=Cuid条件的字段??
有什么解决方法吗?
{
String RowT=HDS.Tables["T_hppcustomertype"].Rows[j]["customerid"].ToString();
DataRow[] RowM = HDS.Tables["T_hppcustomertype"].Select(RowT+"="+Cuid);
foreach (DataRow dr in RowM)
{
dr.Delete();
dr.EndEdit();
}
HDS.AcceptChanges();
}
请问为什么上面这段代码不能完成删除RowT=Cuid条件的字段??
有什么解决方法吗?
解决方案 »
- 发生异常: Invalid URI: The URI is empty.
- c/s中用顾及到SQL注入么
- C# 如何把控件 treeView1的值 copy一份给 treeView1?要值传递 急用
- 在c#中,怎么能把pdf中的内容,读出到DataSet里面?
- 急!ExecuteNonQuery() 返回值的问题?为什么和查询分析器中的结果不一致?
- Active Directory:怎样用ADSI查询显示扩展类对象
- 咨询下
- 将DataGrid中的数据导出到exle里遇到的问题.(无法将ButtonColumn类型的列导出)在线等...
- 怎样声明方法参数中的enum?
- 一个简单但是在编程中经常碰到的问题,各位帮帮忙了!
- 如何获得winform中listBox中的所有值?
- ACCESS里面,怎么根据一个字段名称,读取字段的类型啊??
{
//String RowT=HDS.Tables["T_hppcustomertype"].Rows[j]["customerid"].ToString();
DataRow[] RowM = HDS.Tables["T_hppcustomertype"].Select("customerid="+Cuid);
foreach (DataRow dr in RowM)
{
dr.Delete();
dr.EndEdit();
}
HDS.AcceptChanges();//如果你想更新数据库,请更新完后再AcceptChanges.
}
DataRow[] RowM = HDS.Tables["T_hppcustomertype"].Select("customerid="+Cuid);
foreach (DataRow dr in RowM)
{
dr.Delete();
dr.EndEdit();
}