Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / September 2006

Tip: Looking for answers? Try searching our database.

How do I connect to SQL database using applicaiton roles and ado.net?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ken Varn - 27 Sep 2006 22:48 GMT
My MSDE database uses Application Roles.  When I run my asp.net application
I cannot open the database, I get a Logon Failed exception.  I need to be
able to open the DB to run the sp_setapprole stored procedure for my role
access.  Is there some other way that I can do this?  So far the only way I
can get this to work is to give the ASP.NET process SYSTEM rights.  I would
prefer to use the ASPNET user rights.

My connection string is as follows:

"Pooling=false;Server=(local);Integrated Security=SSPI;Database=MyDb"

Signature

-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------

William (Bill) Vaughn - 28 Sep 2006 00:57 GMT
Did you grant rights to the ASPNET account in SQL Server? (I assume you're
using IIS 5.0). IIS 6.0 uses IUSR_<computername>.

Signature

____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
_________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)

INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

> My MSDE database uses Application Roles.  When I run my asp.net
> application
[quoted text clipped - 9 lines]
>
> "Pooling=false;Server=(local);Integrated Security=SSPI;Database=MyDb"
Ken Varn - 28 Sep 2006 14:20 GMT
I just tried that and it seemed to fix part of the problem.  However I am
still having some permission issues at times.  I think it may have something
to do with user impersonation.  There are some areas in the ASP.NET code
that impersonate an admin and the revert back.  Would this mess up an open
connection to a DB to cause my current application role to get reset?

Signature

-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------

Did you grant rights to the ASPNET account in SQL Server? (I assume you're
using IIS 5.0). IIS 6.0 uses IUSR_<computername>.

Signature

____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
_________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)

INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

> My MSDE database uses Application Roles.  When I run my asp.net
> application
[quoted text clipped - 9 lines]
>
> "Pooling=false;Server=(local);Integrated Security=SSPI;Database=MyDb"
William (Bill) Vaughn - 28 Sep 2006 18:48 GMT
Running SQL Server on one server and IIS on another can be problematic. It
requires a second level of security redirection that's especially hard to
configure. I would research "impersonation" on MSDN and elsewhere... I for
one, avoid it. I think you're on the right track though.

Signature

____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
_________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)

INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

>I just tried that and it seemed to fix part of the problem.  However I am
> still having some permission issues at times.  I think it may have
[quoted text clipped - 19 lines]
>>
>> "Pooling=false;Server=(local);Integrated Security=SSPI;Database=MyDb"

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.