Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my web.config file i have given like this.

XML
<system.web>
       <rolemanager enabled="true" />
       <authentication mode="Forms" />
       <compilation debug="true" targetframework="4.0" />
   </system.web>

   <system.web>
       <sessionstate mode="SQLServer">
                     sqlConnectionString="mycon"
                     sqlCommandTimeout="30"
                     cookieless="UseUri"
                     timeout="20"&gt;
       </sessionstate>

   </system.web>
   <connectionstrings>
       <add name="mycon" connectionstring="Data Source=Sreekanth; Integrated Security=True; Database=Northwind" />
   </connectionstrings>



error is
The sqlConnectionString attribute or the connection string it refers to cannot contain the connection options 'Database', 'Initial Catalog' or 'AttachDbFileName'. In order to allow this, allowCustomSqlDatabase attribute must be set to true and the application needs to be granted unrestricted SqlClientPermission. Please check with your administrator if the application does not have this permission.

I want to access the connection string in my application.
Posted
Updated 22-Jun-12 18:31pm
v2
Comments
Ranjith Reddy CSE 23-Jun-12 1:27am    
and also Include....Initial Catalog as ur Database Name in Web.config ConnectionString File.

Try this, it will help u.

and also Include....Initial Catalog as ur Database Name in Web.config ConnectionString File.

Try this, it will help u.
 
Share this answer
 
v2
See[^] sqlConnectionString attibute is inside the sessionstate elment.It seems you have specified something wrong at a syntax level.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900