强类型数据集CustomerList,Web引用localhost.PMService
做如下操作:
localhost.PMService pm=new HaoTest.localhost.PMService();
localhost.CustomerList cl1=pm.GetMyCustomers(2);
localhost.CustomerList.CustomerRow dr=cl1.Customer.FindByID(10);
cl1.Customer.RemoveCustomerRow(dr);
pm.UpdateMyCustomerList(cl1);
不能删除编号为10的记录!
但是如果将cl1的数据显示到DataGrid上(Winform),然后选择编号10的行,按Del键删除,再执行
localhost.PMService pm=new HaoTest.localhost.PMService();
DataSet ds=dataGrid4.DataSource as DataSet;
localhost.CustomerList cl=new HaoTest.localhost.CustomerList();
cl.Merge(ds);
pm.UpdateMyCustomerList(cl);
就可以将编号为10的记录删除!
不知是何原因,你请指教!(CustomerList 和localhost.PMService 在同一项目中)
做如下操作:
localhost.PMService pm=new HaoTest.localhost.PMService();
localhost.CustomerList cl1=pm.GetMyCustomers(2);
localhost.CustomerList.CustomerRow dr=cl1.Customer.FindByID(10);
cl1.Customer.RemoveCustomerRow(dr);
pm.UpdateMyCustomerList(cl1);
不能删除编号为10的记录!
但是如果将cl1的数据显示到DataGrid上(Winform),然后选择编号10的行,按Del键删除,再执行
localhost.PMService pm=new HaoTest.localhost.PMService();
DataSet ds=dataGrid4.DataSource as DataSet;
localhost.CustomerList cl=new HaoTest.localhost.CustomerList();
cl.Merge(ds);
pm.UpdateMyCustomerList(cl);
就可以将编号为10的记录删除!
不知是何原因,你请指教!(CustomerList 和localhost.PMService 在同一项目中)
介绍下是为什么啊