Hello all,
I am writing an application in ASP.NET that uses a DataGrid to display product information. I am having trouble with passing the delete funtion on to the Access Database and was wondering if someone could help as I am fairly new at this...
Here is the code I have so far:
I have the query and connection in place but I am not sure how to get this statement to be EXECUTED on the database to actually delete the record.
Any help is greatly appreciated.
Cheers
I am writing an application in ASP.NET that uses a DataGrid to display product information. I am having trouble with passing the delete funtion on to the Access Database and was wondering if someone could help as I am fairly new at this...
Here is the code I have so far:
Code:
query = "Delete From Products Where ProductID = "+ pID +"";
OleDBConnection conn = new OleDbConnection(connection);
OleDbDataAdapter adapter = new OleDbDataAdapter();
adapter.DeleteCommand = new OleDbCommand(query, conn);
I have the query and connection in place but I am not sure how to get this statement to be EXECUTED on the database to actually delete the record.
Any help is greatly appreciated.
Cheers