Solved

ASP.NET / SQL Database Deployment

Posted on 2008-10-13
11
539 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

840 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