Hi all,
I need to delete rows from my db, when the criteria is: older than a certain date.
Can it be done without an SQL string query?? Using only a DataSet and/or DataAdapter?
The regular SQL would be: "DELETE FROM EventLog WHERE EL_TimeStamp<01/08/2006".
But the problem is using the date in C# and Access-database.
Thanks in advance,
Danny
Loading
Enam ulhaquePosted Aug 5, 2006, 4:54 PM
But if you have problem with localization then do check the date using datepart()
function of sqlserver.(if u r using it)
Then using adapter's delete command u can update your database using dataset.
e.g.
SqlDataAdapter ad= new SqlDataAdapter("",connectionString);
ad.DeleteCommand.CommandText="Delete................(what ever you command is)";
now call the update method of adapter.
like
ad.Update(dataSet,"TableName");
With Regards.
Enam ul haque.
(Correct me if i'm wrong)