ASP.NET / SQL Database Deployment

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.

LVL 27
VBRocksAsked:
Who is Participating?
 
prairiedogCommented:
Does (MachineName)\ASPNET account have access to your SQL Server?
0
 
tiagosalgadoCommented:
Add this to your web.config
<trust level="Full"/>
0
 
tiagosalgadoCommented:
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
VBRocksAuthor Commented:
Where do I add this, anywhere?

     <trust level="Full"/>

0
 
tiagosalgadoCommented:
Under <system.web>
Check this example http://msdn.microsoft.com/en-us/library/tkscy493.aspx
 
0
 
prairiedogCommented:
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
 
VBRocksAuthor Commented:
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
 
prairiedogCommented:
Do you have firewall installed on your PC where the SQL Server installed? If yes, is the port opened?
0
 
VBRocksAuthor Commented:
I have the firewall disabled (windows & kaspersky).

0
 
tiagosalgadoCommented:
0
 
VBRocksAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.