?
Solved

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

Posted on 2002-07-29
5
Medium Priority
?
504 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 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month16 days, 19 hours left to enroll

862 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