Solved

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

Posted on 2002-07-29
5
453 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]
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
>>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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now