WebService doesn't read web.config

Posted by phenevo on Stack Overflow See other posts from Stack Overflow or by phenevo
Published on 2010-04-06T08:34:40Z Indexed on 2010/04/06 9:23 UTC
Read the original article Hit count: 391

Filed under:
|
|

Hi,

I've got 3 connectionstrings in web.config, and I used theirs like this:

using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["SomeName"].ConnectionString))

Every metgod is called by winforms application.

One of webmethods doesn't work properly because it reads only one connectionString:

data source=.\\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true

It's not a connectionString from my web.config .

I invoke every method in the same way.

How it's impossible ??

© Stack Overflow or respective owner

Related posts about c#

Related posts about webservice