Click here to Skip to main content
15,886,638 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to create a C# web application which get Server Name , Instance , User , Password of Remote Sql Servers from user and run a query on their databases. I also want to save Remote Sql Servers info in order to reuse them . Please Help me how to start . Is it essential to use SMO ?
Posted
Comments
Kornfeld Eliyahu Peter 19-Jan-14 4:19am    
There is a lot of resources out-there... Try a bit of Google and come back with more specific questions!

1 solution

Basically, you will form the ConnectionString from the User Inputs and connect to the Database.
Without using SMO, you can achieve the task by ADO.NET Objects.

You need to form that ConnectionString, then Connect to that Server using SqlConnection Class.
Initialize SqlCommand Class and do Execute the query.

You can save that info either in Database, web.config or some other files in your Server.
 
Share this answer
 
Comments
Kornfeld Eliyahu Peter 19-Jan-14 4:42am    
As informative as the question :-)
Thanks. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900