Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2002-07-29
5
Medium Priority
?
502 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 400 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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)…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

636 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