Thursday, March 29, 2012

Direct Interface to SQL server

I did a little bit of looking in the forums for something like this, but I wasn't able to find anything. In essence, I am looking to create a web form in ASP.NET which will emulate the SQL Server Query Analyzer Tool... eventually what I'd like to see:

- A dropdown of different connection strings, to connect to different databases

-A multi-line textbox where a user could type in a query (be it a SELECT, CREATE, UPDATE, or multiple queries at once)

-A gridview object for results

-A multiline textbox to contain server output ("the command completed successfully", "xxx rows returned", "syntax at line 3 not recognized", etc)

I can do the first 3 without any difficulty, but I have absolutely no idea where to start with the server output. Anyone have any ideas? It does not need to be secure, as the only databases they'll have access to will be "test" databases and the pages will not be publicly hosted (LAN only)

Hi,

You need to handle OnInfoMessage event for your connection object. Pleas have a look at this for more information

http://msdn2.microsoft.com/en-us/library/a0hee08w(VS.80).aspx

Regards

|||

That worked beautifully... thank you so very much.

Are there any issues with removing "Shared" from the "protected shared sub " declaration? I had to remove it in order to address the textbox which contained the server messages handled in the event handler.

No comments:

Post a Comment