Solved

ASP.NET / SQL Database Deployment

Posted on 2008-10-13
11
510 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
  • 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
 
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now