Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 11902 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > Getting error in web.config file. ...
Sreekanthv5

Getting error in web.config file.

Replies: 2 | Posted by: Sreekanthv5 on 6/23/2012 | Category: ASP.NET Forums | Views: 442 | Status: [Member] | Points: 10  


In my web.config file i have given like this.
<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.


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Rajkatie
Rajkatie  
Posted on: 6/23/2012 1:33:53 AM
Level: Silver | Status: [Member] | Points: 25

You have to set allowCustomSqlDatabase attribut in <sessionstate> section. For more information refer following link
http://msdn.microsoft.com/en-us/library/h6bb9cz9.aspx


Rajesh Patel
MCP,MCTS,MCPD,MS
Brainbench (Asp.Net 4.0 and CSS 3.0)

Sreekanthv5, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Muralidosscm
Muralidosscm  
Posted on: 6/25/2012 5:52:52 AM
Level: Starter | Status: [Member] | Points: 25

Database=Northwind is microsoft database thats why that message showing..........
give your database name

Regards
Muralidoss M

Sreekanthv5, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/19/2013 7:17:01 AM