codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Sql Connection Advice And Sql Sytem Tables Advice  david_ste at 11:57 on Tuesday, November 01, 2005
 

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.










CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: sorting and Linked list
•  Re: need help linked list
•  Re: Help with arrays
•  Re: Reading from a file
•  Re: Why Use Method?
•  Re: Help with a simple program
•  Re: need help with quiz
•  Re: Help with filesystem object & displaying in a table
•  Re: Genetic Algorithm Help


Recent Articles
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts
MagicGrid
Caching With ASP.Net
Creating CSS Buttons


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005