Solved

ASP.NET / SQL Database Deployment

Posted on 2008-10-13
11
519 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 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

7 Experts available now in Live!

Get 1:1 Help Now