davesil2 Posted December 30, 2003 Posted December 30, 2003 I have a program where I have a dataset that I delete certain rows. Once I have call the delete for that row in the loop I try to update it with the data adapter. I have one of two issues. If I simply run da.update(ds, "time") then is says I need a valide delete command for the data adatper. Otherwise if I have a delete command It deletes all of the rows (it's a foxpro database so it doesn't even really delete them which I need help with too. da.fill(ds, "time") ds.tables("time").rows(i).delete del = new oledb.oledbcommand("DELETE FROM 'TIME'", co) ds.update("time").rows(i).delete the above is what I use for the indiviual lines of code but the above code is not complete as far as what I use. I'm guessing I'm just missinig something small and will feel stupid after hearing the answer but I don't know I've spent quite some time researching on MSDN website and google. Just looking for at least a pointer in the right direction. Thanks in advance. -David silberhorn Quote
makzee Posted January 21, 2004 Posted January 21, 2004 (edited) >> del = new oledb.oledbcommand("DELETE FROM 'TIME'", co) The problem is here ... the query says Delete All Records You must provide parameter like: del = new oledb.oledbcommand("Delete from 'TIME' Where T_ID = @ID ", co) Dim param as OleDb.OleDbParameter = New OleDb.OleDbParameter("@ID", OleDb.OleDbType.Integer)) del.Parameters.Add(param) da.DeleteCommand = del I hope this would help, Zeeshan Q. Ali Edited January 21, 2004 by makzee Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.