?
Solved

ASP.NET / SQL Database Deployment

Posted on 2008-10-13
11
Medium Priority
?
559 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

752 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