J
Jayasriraghu
I am programming in vsto 2003. when i moved my connection string to
app.config, I get error "the connection string property not initialized".
the following code works. I am new to programming. can anybody help?.Thank you
protected void makeConnection()
{
cn = new OleDbConnection();
cn.ConnectionString="Provider=SQLOLEDB.1;user id=sa;password =####;data
source=#####;initial catalog=BPT_TEST";
cn.Open();
}
But the following code doesnot
protected void makeConnection()
{
cn = new OleDbConnection();
cn.ConnectionString =
System.Configuration.ConfigurationSettings.AppSettings["SqlconnString"];
cn.Open();
}
<configuration>
<appSettings>
<add key="SqlconnString" value="Provider=SQLOLEDB.1;user id=sa;password
=#####;data source=######;initial catalog=BPT_TEST" />
</appSettings>
</configuration>
app.config, I get error "the connection string property not initialized".
the following code works. I am new to programming. can anybody help?.Thank you
protected void makeConnection()
{
cn = new OleDbConnection();
cn.ConnectionString="Provider=SQLOLEDB.1;user id=sa;password =####;data
source=#####;initial catalog=BPT_TEST";
cn.Open();
}
But the following code doesnot
protected void makeConnection()
{
cn = new OleDbConnection();
cn.ConnectionString =
System.Configuration.ConfigurationSettings.AppSettings["SqlconnString"];
cn.Open();
}
<configuration>
<appSettings>
<add key="SqlconnString" value="Provider=SQLOLEDB.1;user id=sa;password
=#####;data source=######;initial catalog=BPT_TEST" />
</appSettings>
</configuration>