What's in connTest?
Main Topics
Browse All TopicsHello,
I am using Visual Studio 2005 and here is my connection string and I am getting this error: "The ConnectionString property has not been initialized."
If strDB = "Test" Then
Dim ConnectionString As String = System.Configuration.Confi
conn = New SqlClient.SqlConnection(Co
conn.Open()
End If
What am I doing wrong?
Thanks,
Kim
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Sorry, I am assuming that you are using .NET 2.0 as you are using VS2005.
Both the
System.Configuration.Confi
and the
System.Configuration.Confi
are used to get values specified in the web.config file, heres an example snippet :
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="connTest" value="your connectionstring goes here" />
</appSettings>
Sorry, you must be doing a vb winforms app and not a web app.
I was wrong on that.
open your project in vs2005
in the 'solution explorer' (default location is upper right - choose view->solution explorer from the menu if it is not visible)
right click on your project and choose properties
Click the settings tab.
make sure there is a setting named connTest and set it's value appropriately (if you need examples of what a connection string should look like, check out www.connectionstrings.com)
as a side note- if you are just getting started learning - you don't HAVE to use the appsettings
you could do this instead:
if strDB = "Test" Then
Dim ConnectionString As String = "yourconnectionstringhere"
conn = New SqlClient.SqlConnection(Co
conn.Open()
end if
what goes into "yourconnectionstringhere"
- Jack
Business Accounts
Answer for Membership
by: fruhjPosted on 2007-01-02 at 12:15:26ID: 18230528
Do you have a real connection string in your web.config file, named connTest?