RE: Connection strings?
- From: stcheng@xxxxxxxxxxxxxxxxxxxx (Steven Cheng[MSFT])
- Date: Mon, 31 Dec 2007 02:59:04 GMT
{\rtf1\ansi\ansicpg936\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\lang2052\f0\fs20 Hi Simon,
\par
\par I have seen your another thread on this issue in the same newsgroup. I've replied you there. Welcome to followup and continue to discuss in that thread.
\par
\par Sincerely,
\par
\par Steven Cheng
\par
\par Microsoft MSDN Online Support Lead
\par
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par \pard\li720 --------------------
\par From: "Simon" <none@xxxxxxxx>
\par Subject: Connection strings?
\par Date: Sat, 29 Dec 2007 22:30:10 +010
\par
\par I have created new web service and inserted connection strings to web.config
\par file:
\par
\par <connectionStrings>
\par <add name="ConnStr" connectionString="XXXXXXXX"/>
\par </connectionStrings>
\par
\par When I try to read this connection string:
\par
\par coll = ConfigurationManager.ConnectionStrings;
\par connStr = coll[0].ConnectionString;
\par connStr = coll["ConnStri"].ConnectionString;
\par
\par coll has only one member and that one has ConnectionString value:
\par "data source=.\\SQLEXPRESS;Integrated
\par Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User
\par Instance=true"
\par
\par If I try to read the "ConnStr" value I get null reference exception.
\par
\par Why is that? Is it not enough to change the Web.config file in project and
\par that should work?
\par
\par Thank you
\par
\par Simon
\par
\par \pard
\par
\par }
- References:
- Connection strings?
- From: Simon
- Connection strings?
- Prev by Date: RE: Connection strings
- Next by Date: visual c++.net web service problem
- Previous by thread: Connection strings?
- Next by thread: Connection strings
- Index(es):
Relevant Pages
|