Hi,
I'm a newbie in programming in VB.net and till a few days ago it was going well.
I have build a program with a database (.mdf) connection. this was build in VS 2003 and workt fine.
Now i updated my PC and installed vista with a VS 2005 and then the problems started. It looks i don't get a connection with the database. I use folowing code in the app.config
and this code in my vb.net script
but then i get a message that the code i use is obsolete and i must use following code
but configurationmanager is not reconised in the code????
In bouth cases the database connection does not work
Can someone help me with this problem? Thanks
greetings
Koen
I'm a newbie in programming in VB.net and till a few days ago it was going well.
I have build a program with a database (.mdf) connection. this was build in VS 2003 and workt fine.
Now i updated my PC and installed vista with a VS 2005 and then the problems started. It looks i don't get a connection with the database. I use folowing code in the app.config
VB.NET:
<connectionStrings>
<add name="LiFA.My.MySettings.LiFAConnectionString" connectionString="Data Source=.\SQLEXPRESS;
AttachDbFilename=|DataDirectory|\database\LiFA.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
and this code in my vb.net script
VB.NET:
strCon = Configurationsettings.AppSettings("connectionStrings")
conMyData = New SqlConnection(strCon)
but then i get a message that the code i use is obsolete and i must use following code
VB.NET:
strCon = ConfigurationManager.AppSettings("connectionStrings")
conMyData = New SqlConnection(strCon)
but configurationmanager is not reconised in the code????
In bouth cases the database connection does not work
Can someone help me with this problem? Thanks
greetings
Koen