![]() |
error vsto application can't access connection string in app.confi
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.AppSett ings["SqlconnString"]; cn.Open(); } <configuration <appSettings <add key="SqlconnString" value="Provider=SQLOLEDB.1;user id=sa;password =#####;data source=######;initial catalog=BPT_TEST" / </appSettings </configuration |
All times are GMT +1. The time now is 05:53 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com