Insert SQL statements into a DB record using Command object?

  • Thread starter Thread starter Sarah Smith
  • Start date Start date
S

Sarah Smith

Hello,

I'm porting a VB6 / ADO application to VB/ADO.net and I'm running into
some ADO.Net problems.

I have a system that allows users to write and test their own SQL
statements, and then save them to the SQL Server in a table called
AdHoc.

(They are not allowed to use certain destructive statements such as
DROP, DELETE)

When they are happy with the results of the query, they save the SQL,
and a short menu text into the database. They can then select and run
the query they created by choosing it from a combo box (using the menu
text).

This was never a problem in ado classic, but when I use an ADO.net
command object and call the .ExecuteNoneQuery method, it seems that
the SQL statements I want to add or update in the database, are
getting mixed up in the SQL Insert or Update statements that actually
do the saving/updating of the database.

So I guess my question is: how can I execute an SQL statement that has
string fields, that contain SQL statements themselves.

Anyone?

ss.
 
Back
Top