Monday, March 26, 2012

Web.config Problem

I moved my connection string into the web.config file and am now getting the following error...

Format of the initialization string does not conform to specification starting at index 0.

here is the code

Dim myConnection As New SqlConnection("ConnectionString")

<add key="ConnectionString" value="Server=(local);Trusted_Connection=true;database=VQUEDTA100" />You need to do the following:

 Dim myConnection As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))

Hi,

Check out the website www.ConnectionStrings.com

0 comments:

Post a Comment