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 / ASP.NET / Security / August 2003

Tip: Looking for answers? Try searching our database.

Newbie Question  - "trusted SQL Server connection"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg Smith - 20 Aug 2003 19:25 GMT
I am just getting started with ASP.Net.  I am attempting to place a dateGrid
on a page and I have done all the things I would do in a Windows
application:

- drag a connection to the form
- preview the data
- generate a data set

When I run the app I get:

"Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection."

string strConnectionString = "packet size=4096;user
id=MyUserName;password=MyPassword;integrated security=SSPI;data
source=MAGRATHEA;persist security info=False;initial catalog=Tracker";
cn.ConnectionString = strConnectionString;
da.Fill(ds.tblInfo);

It fails on the .fill.

The above works perfectly in a WinApp but apparently the user name is not
picked up as I would have thought.  There is obviously some additional
voodoo I need to do on the web side.

Any help is greatly appreciated.
Chris Jackson - 20 Aug 2003 19:43 GMT
Your connection string contains the text "integrated security=SSPI", which
indicates that you want to use the Security Support Provider Interface. In
other words, you want to use Windows authentication. This will work fine on
your Windows applications, as long as the user who launched the application
has permissions to the database you are trying to connect to. However, the
account MACHINE\ASPNET (which is the process identity that ASP.NET runs
under by default) does not have the ability to authenticate to another
server (unless you either control the password or else get very lucky),
which is the windows authentication information you are passing. Try
removing this from your connection string if your intention is to use SQL
authentication.

Signature

Chris Jackson
Software Engineer
Microsoft MVP - Windows XP
Windows XP Associate Expert
--

> I am just getting started with ASP.Net.  I am attempting to place a dateGrid
> on a page and I have done all the things I would do in a Windows
[quoted text clipped - 22 lines]
>
> Any help is greatly appreciated.

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.