Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with DB Connection

Status
Not open for further replies.

BillLumbergh

Programmer
Aug 15, 2001
51
US
I am in the process of learning C#/.Net and am going through the QUE 70-315 Training Guide by Amit Kalani. The book is not necessarily relevant to my question but I am including it in case someone has also used the book. I am doing an exercise that builds a single-table data form (Step By Step 5.11 for those with the book). I am using the Data Form Wizard. I select MS OLE DB Provider for SQL Server provider, (local) server, NT Security, and Northwind database. When I click the Test Connection button on the wizard, it connects successfully. When I run the project and click the button that accesses the data, the page comes back with the message "Login failed for user JCL\ASPNET". JCL is my machine name.

I am running Windows 2000 Pro and SQL Server 2000 Developer Edition. I had this same problem but managed to fix it yesterday; I tried many things, and what I believe worked was running "aspnet_regiis -i" from the VS.Net command prompt. However, when I booted today and began working again, the old problem was back. This time, my "solution" from yesterday did not work, so I'm assuming this was not really a solution. I have compared my various settings to another person I am working in conjunction with; my settings are the same as his and he does not have this problem. I am able to access the database through Enterprise Manager without a problem.

Has anyone had this problem and know how to fix it?

Thanks in advance.
 
I understand you are using local MSSQL server and I think another person are using also his local MSSQL server.
First of all I will suggest to use SQL server authentication for the MSSQL instead of Windows NT authentication.
Next I will check
Computer management ->Local Users and Groups ->IUSR_yourMachine ,IWAM_yourMachine and ASPNET user.

-obislavu-
 
I ended up getting this to work by adding the user ASPNET to SQL Server users list and giving him read/write access to Northwinds database. Then in the data wizard, I used SQL Server Authentication instead of NT. Still frustrated though by the fact that I could sporadically get it to work using NT authentication, and I was never able to identify the cause. I got it to work, changed one thing, it didn't work, so I changed it back to the way it was when it was working, and it didn't work, even though it had previously worked with what seem to be the exact same settings. Doesn't seem logical and that bothers me but I've already invested too much time in getting it to work and now that it does I'm just going to move on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top