Solved

VB.Net - Can't open DataSet with SQL string

Posted on 2002-07-29
5
477 Views
Last Modified: 2008-02-01
Hi I'm trying to create a simple web application using VB.Net and Northwind as my database. I'm stuck with this error in all my search forms fields. The errors goes like this -

Can't open DataSet with SQL string: 'SELECT * FROM dbo.Categories ORDER BY CategoryID' Error Message--Login failed for user 'BLACKEN-WACQYK7\ASPNET'.

What could cause this problem and how can I fix this?
0
Comment
Question by:philcp
  • 3
  • 2
5 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7184828
The user 'BLACKEN-WACQYK7\ASPNET' needs to have access to the northwind database.
* If it's Access:
   you need to give it permissions to the .mdb file
* If it's SQL Server:
   create a login in the SQL Server logins, and supply the permissions and access to the northwind database.

CHeers
0
 

Author Comment

by:philcp
ID: 7184895
I'm suprise as to why didn't VS.Net didn't automatically create that user for me? Is it always this way?
0
 

Author Comment

by:philcp
ID: 7184914
Still happens with the same error. What I did was to go to Northwind in MSSQL. Add user ASPNET. But the thing is when I created a new user in Northwind database, that is when my 'Database User Properties - New User' dialog box appears, I have 2 combo boxes. In the Login Name combo box, I have the default selection of BUILTIN\Administrator and BLACKEN-WACQYK7\Administrators. And I can't choose anything else. Thus I used that the later and named the user ASPNET. But the same problem occurs.

Next I went specifically to the C:/MSSQL/DATA folder and set the permission to Northwind.mdf to include BLACKEN-WACQYK7\ASPNET. But that still doesn't work.

Could it then be a problem with my virtual directory in my IIS?

I'm currently running out of ideas. And the next move I have left is to port this codes to another machine and see if the same problem occurs there. Unless, anyone can help me out. Thanks.
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 100 total points
ID: 7184937
>>why didn't VS.Net didn't automatically create ...
VS.net doesn't know what you do in your web pages, it cannot "interpret" your code. How should and development tool know which database you connect to?!

>>What I did was to go to Northwind in MSSQL, add user
You went to the wrong place, as you try to create a user in the database. You must create a LOGIN at server level, thus go to server security folder (in MMC), creating an login based on NT account. There you choose the account 'BLACKEN-WACQYK7\ASPNET'. In the Database access tab you check the nortwind database and also give the permissions as requested.

CHeers
0
 

Author Comment

by:philcp
ID: 7184957
Yeah! It works... Thanks a mill angellll. About the question on why didn't VS.Net automatically create it. I was actually trying out a new tool called Rdp (www.rdptools.com). Its suppose autmatically generate .Net codes based on in-built or customized templates. Guess there's some weaknesses to it.
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

825 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