mjs84
Aerospace
- Aug 20, 2003
- 27
I am a newbie with vb.net and SQL and I have run into a bit of a snag.
I have written code to manipulate an SQL database. I have routines to connect, read, query, edit, add, delete and update data to the database.
Everything seems to be working just fine, except the delete function. I am not getting any errors - the data just does not get deleted from the database.
The method I'm employing is declaring a dataset and a data adapter. I am filling the dataset, (mydataadapter.fill(mydataset,tbl)), then updating the database thru the data adapter. When I do the delete function (rows.remove), it removes the line from the dataset, but the database does not get updated. The update function works when I add or edit data, just not when I delete data.
I have a sqldataadapter control on the form. The properties page for this control has a the following delete command:
DELETE FROM Emp01
WHERE (EmpID = @Original_EmpID) AND (FName = @Original_FName OR
@Original_FName IS NULL AND FName IS NULL) AND (LName = @Original_LName OR
@Original_LName IS NULL AND LName IS NULL)
Any help would definitely be appreciated - I am really struggling with this.
Thanks in advance.
I have written code to manipulate an SQL database. I have routines to connect, read, query, edit, add, delete and update data to the database.
Everything seems to be working just fine, except the delete function. I am not getting any errors - the data just does not get deleted from the database.
The method I'm employing is declaring a dataset and a data adapter. I am filling the dataset, (mydataadapter.fill(mydataset,tbl)), then updating the database thru the data adapter. When I do the delete function (rows.remove), it removes the line from the dataset, but the database does not get updated. The update function works when I add or edit data, just not when I delete data.
I have a sqldataadapter control on the form. The properties page for this control has a the following delete command:
DELETE FROM Emp01
WHERE (EmpID = @Original_EmpID) AND (FName = @Original_FName OR
@Original_FName IS NULL AND FName IS NULL) AND (LName = @Original_LName OR
@Original_LName IS NULL AND LName IS NULL)
Any help would definitely be appreciated - I am really struggling with this.
Thanks in advance.