A
acoles
Hi,
I have a requirement in a current project to show the effect of a
particular SQL Statement on a given database table.
The statement will only effect one row but could be an UPDATE, DELETE
or an INSERT command. The user should see the table row before and
after for an UPDATE, a new row for an INSERT and the row to be removed
for a DELETE command. I intend to represent a copy of the table before
and after the query has been run (without affecting the database) as a
DataView object.
Does anyone know whether there is any built in functionality for
executing raw SQL statements against ADO.NET objects?
My current plan (not find anything more suitable) involves creating a
function which would parse the SQL statement as a string and determine
the target table and the type of query (it would always start with
either INSERT, DELETE or UPDATE). It would then locate the WHERE
clause which could easily be applied to a DataView of the table.
Has anyone else ever come across something like this before? I am
relatively new to .NET and am not sure whether they would be a more
elequent/faster approach. Any views would be greatly appreciated! I
am writing the application in C# although that is probably irrelevant
here.
Thanks!
Andrew
I have a requirement in a current project to show the effect of a
particular SQL Statement on a given database table.
The statement will only effect one row but could be an UPDATE, DELETE
or an INSERT command. The user should see the table row before and
after for an UPDATE, a new row for an INSERT and the row to be removed
for a DELETE command. I intend to represent a copy of the table before
and after the query has been run (without affecting the database) as a
DataView object.
Does anyone know whether there is any built in functionality for
executing raw SQL statements against ADO.NET objects?
My current plan (not find anything more suitable) involves creating a
function which would parse the SQL statement as a string and determine
the target table and the type of query (it would always start with
either INSERT, DELETE or UPDATE). It would then locate the WHERE
clause which could easily be applied to a DataView of the table.
Has anyone else ever come across something like this before? I am
relatively new to .NET and am not sure whether they would be a more
elequent/faster approach. Any views would be greatly appreciated! I
am writing the application in C# although that is probably irrelevant
here.
Thanks!
Andrew