Insert SQL statements into a DB record using Command object?

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top