|
I want to create a C# windows application where I have a start form where I can input a usernname / password, server / database and a drop down where the user will specify whether they want to connect to a SQL or OLEDB Database.
This will then connect to the chosen Database and pull back all the tables from the DB from which the user should be able to select a table and generate information from that table.
At the moment I am not to sure where I should store the connection string. Which will be used in other forms as well.
I know that I am looking for something like
SqlConnection myConnection = new SqlConnection("server=(""" + txtServer + """);User Name = """ + txtuser + """; Password= """ + txtPassword + """;database=""" + txtDatabase + """);
But am not sure where would be the best place to store the connection string as I believe that I could not store it in the web.config file because I can not write dynamic content in there.
I was also wanting to have a data grid on the second form where the user can select a table and then I want to generate info based on the selected table. Think I will need to use the system tables to pull in tables stored in the chosen DB and information on those tables. Was looking for any good advice on this as well.
Thank You.
|
|
|
|
|
|
|
|