c# - Run SQL statements from ASP.net application -


I need to run my own SQL statement from the application. I mean the user ASP.N.T Can go to the app, take a box and run SQL statement from there

I'm already doing something like this

This dynamic SQL is running

Do this. There is an optional SQL parameter, but your users will need to define and define different parameters from T-SQL.

You can simply use SQL Command Object on SQL Server to SQL Server; There is no real advantage to wrapping in an EXEC or something, as you did in the link provided you can handle exceptions on the .NET side.

In addition, if you want to support command batches, keep in mind that SqlClient and friends do not understand "GO", which is not real T-SQL Command - to parse you input And it will need to break into your batches.

I'm sure you understand that there is a big security risk to do this, and it is generally not recommended. You may consider using a connection string that specifies the user with limited permissions, so that their access can be controlled / limited.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -