Insert, Update, Delete using Oledb |
Answered By
Moderator1
on
5/29/2010 10:04:36 PM |
|
|
Hi,
Below I'm provide some sample code to use OledbCommand object. Please change the insertSQL query according to your requirement.
string insertSQL="Insert into TableName values ('"+ Value1 +"', '"+ Value2 +"')"
OleDbConnection myConnection = new OleDbConnection("YourConnectionString");
OleDbCommand myCommand = new OleDbCommand(myExecuteQuery, myConnection);
myCommand.Connection.Open();
myCommand.ExecuteNonQuery();
myConnection.Close(); |
|
|