Click here to Skip to main content
16,017,857 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to delete microsoft access table rows using access column values C#

What I have tried:

I have done in this way

C#
//string str = "insert into        eBSV_Rules(Idx,RuleCode,RuleName,TableName,Conditions,DisplayMessage,,) values     (@id,@name)";
string sql = " DELETE FROM eBSV_Rules WHERE [Idx] = ? ";
//'" +  ? + "'
my_con.Open();
OleDbCommand My_Command = new OleDbCommand(sql, my_con);
My_Command.ExecuteNonQuery();

bindgrid();
Posted
Updated 11-Mar-16 4:47am
v2
Comments
ZurdoDev 11-Mar-16 9:21am    
You never add a parameter.

1 solution

You never added the OldDbParameter object to the OleDbCommand's Parameters collection. You kind of need that to fill the ? you have in the query.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900