Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Globally change an Access connection string PJFry Excel Discussion (Misc queries) 0 June 26th 09 12:25 AM
ADO connection string error?? Brent Excel Programming 2 April 3rd 07 07:56 PM
A problem in VSTO Excel application deployment loop Excel Programming 1 August 16th 06 03:00 AM
Progamatically Formating Cells within VSTO for Excel Application Development using C# Sharad Vyas Excel Programming 5 December 10th 05 04:42 AM
EXCEL, VSTO: Fastest way to access multiple cells Alan Excel Discussion (Misc queries) 1 June 1st 05 02:45 PM


All times are GMT +1. The time now is 09:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"