problem with oledbDataAdapter delete command

fguihen

Well-known member
Joined
Nov 10, 2003
Messages
248
Location
Eire
my oleDb Delete commands are not working.

i have an oledbDataAdapter with insert, update and delete commands like so:

Code:
this.daRequests.InsertCommand = conn.CreateCommand();							this.daRequests.InsertCommand.CommandText = "insert into requests(patient_id,requests)" +
														"values(@patient_id,@requests)";
this.daRequests.InsertCommand.Parameters.Add("@patient_id",OleDbType.VarChar,50,"patient_id");
this.daRequests.InsertCommand.Parameters.Add("@requests",OleDbType.VarChar,120,"requests");

this.daRequests.UpdateCommand = conn.CreateCommand();
this.daRequests.UpdateCommand.CommandText = "update requests set requests = ? where patient_id =?";
this.daRequests.UpdateCommand.Parameters.Add("@requests",OleDbType.VarChar,120,"requests");
this.daRequests.UpdateCommand.Parameters.Add("@patient_id",OleDbType.VarChar,50,"patient_id");

this.daRequests.DeleteCommand = conn.CreateCommand();
this.daRequests.DeleteCommand.CommandText = "delete from requests where patient_id = @patient_id and requests = @requests";
this.daRequests.DeleteCommand.Parameters.Add("@patient_id",OleDbType.VarChar,50,"patient_id");
this.daRequests.DeleteCommand.Parameters.Add("@requests",OleDbType.VarChar,120,"requests");
the insert commands work fine. i dont really use the update ones as the table is mapped to a data grid so a row is either added or deleted, not edited. can anyone see a problem with the delete statement?
 
Back
Top