Murray Brown
asked on
VB.net Build connection string for SQL 2008
Hi
I have a simple form with four boxes:
1. Server
2. Database name
3. Username
4. Password
What VB.net code would I use to build a connection string for a SQL 2008 database.
Now I know you can look at http://www.connectionstrings.com/
but has anyone written VB.net code to do this
I have a simple form with four boxes:
1. Server
2. Database name
3. Username
4. Password
What VB.net code would I use to build a connection string for a SQL 2008 database.
Now I know you can look at http://www.connectionstrings.com/
but has anyone written VB.net code to do this
<connectionStrings>
<add name="ConnectionInfo" connectionString="SERVER=S ervername; Database=d atabasenam e;User ID=YourUserID;password=You rPass;init ial catalog=dbname;" providerName="System.Data. SqlClient" />
</connectionStrings>
<add name="ConnectionInfo" connectionString="SERVER=S
</connectionStrings>
ASKER
Maybe I didn't explain myself well. I want code that builds the text of the connection string given the four parameters
In my code above where i declare the connection string just
Replace each value with your texbox.text
Replace each value with your texbox.text
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks very much
Open in new window
then in your code call your data base as
Open in new window