问题描述
///<summary>///OID删除///</summary>///<paramname="OID">OID</param>///<returns></returns>publicstaticintDelete(stringOID){HOTELSClassLibrary.Room_DeviceTableAdapters.Room_DeviceTableAdapterRoom_DeviceTableAdapter=newHOTELSClassLibrary.Room_DeviceTableAdapters.Room_DeviceTableAdapter();Room_DeviceRoom_Device=Room_Device.GetDataByOID(OID);Room_Device._Room_Device[0].Delete();returnRoom_DeviceTableAdapter.Update(Room_Device);}///<summary>///删除///</summary>///<returns></returns>publicstaticintDelete(){HOTELSClassLibrary.Room_DeviceTableAdapters.Room_DeviceTableAdapterRoom_DeviceTableAdapter=newHOTELSClassLibrary.Room_DeviceTableAdapters.Room_DeviceTableAdapter();Room_DeviceRoom_Device=Room_Device.GetData();Room_Device._Room_Device.Clear();returnRoom_DeviceTableAdapter.Update(Room_Device);}请问为什么第一个OID删除可以第二个删除所有不行没反应也不报错第一个是先把一行拿出来然后删除回填第二个是把所有拿出来然后清空回填请高手支招百思不得其解!!!
解决方案
解决方案二:
第二个也要删除,再更新
解决方案三:
Room_Device._Room_Device.Clear();??清空不行吗?怎么删除告诉我?我是想删掉所有数据