Solved

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

Posted on 2002-07-29
5
488 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 143

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 143

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

685 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