Solved

ASP.NET / SQL Database Deployment

Posted on 2008-10-13
11
552 Views
Last Modified: 2012-05-05
Ok...  I'm getting frustrated here...  help?

I've developed an ASP.NET website that uses an SQL Server database.  It works awesome in the VS IDE.  I've deployed the website to my own computer, and I'm going to allow access to it within my company network.

So far, the deployment works great:  I can access any ASP.NET webpage that does not have database access.  The ASP.NET code executes as expected and produces the desired results.

However, when I try to access a webpage that access the SQL Server database (on my pc also), I get the following Security Exception:

     Description: The application attempted to perform an operation not allowed by the security policy.  To
     grant this application the required permission please contact your system administrator or change the
     application's trust level in the configuration file.


What's a poor windows programmer do?  Thx.

0
Comment
Question by:VBRocks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
11 Comments
 
LVL 8

Expert Comment

by:tiagosalgado
ID: 22704173
Add this to your web.config
<trust level="Full"/>
0
 
LVL 8

Expert Comment

by:tiagosalgado
ID: 22704181
0
 
LVL 27

Author Comment

by:VBRocks
ID: 22704197
Where do I add this, anywhere?

     <trust level="Full"/>

0
Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

 
LVL 8

Expert Comment

by:tiagosalgado
ID: 22704225
Under <system.web>
Check this example http://msdn.microsoft.com/en-us/library/tkscy493.aspx
 
0
 
LVL 22

Expert Comment

by:prairiedog
ID: 22704272
Is your SQL Server set to "Windows Authentication" mode or mixed mode? You should use the mixed mode for your web application to connect to it.

Right click SQL Server --> Properties -->Security

2008-10-13-122516.jpg
0
 
LVL 27

Author Comment

by:VBRocks
ID: 22704331
prairiedog - it's set to Mixed Mode.

tiagosalgado - that didn't work.  I'll have to check out the link from your second post.

0
 
LVL 22

Expert Comment

by:prairiedog
ID: 22704353
Do you have firewall installed on your PC where the SQL Server installed? If yes, is the port opened?
0
 
LVL 27

Author Comment

by:VBRocks
ID: 22704422
I have the firewall disabled (windows & kaspersky).

0
 
LVL 8

Expert Comment

by:tiagosalgado
ID: 22704470
0
 
LVL 22

Accepted Solution

by:
prairiedog earned 500 total points
ID: 22704484
Does (MachineName)\ASPNET account have access to your SQL Server?
0
 
LVL 27

Author Comment

by:VBRocks
ID: 22722414
prairiedog - that's exactly it.

I created a different account and gave it Standard permissions. Then went into IIS, to the website properties | Directory Security, and set the UserName and Password to that account.

Works like a charm.

Thanks!
0

Featured Post

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question