Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Globally change an Access connection string | Excel Discussion (Misc queries) | |||
ADO connection string error?? | Excel Programming | |||
A problem in VSTO Excel application deployment | Excel Programming | |||
Progamatically Formating Cells within VSTO for Excel Application Development using C# | Excel Programming | |||
EXCEL, VSTO: Fastest way to access multiple cells | Excel Discussion (Misc queries) |