473,327 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Interesting SQL Server/.NET behavior

We're having an issue here at school with trying to access a SQL
Server database from a .NET application. As a department, we roll out
a generic image to all of our lab computers. For some reason we were
getting "SQL Server does not exist or access denied" errors (
http://www.isy.vcu.edu/~cstewart/sqlerror.jpg ). One of the lab
machines in the lab worked fine and could connect without any issues.
As a quick fix, we re-imaged 3 of the machines that didn't work with
the one that did work. That resolved the issue for the current class
that needs to do this.

Today I went and downloaded one of the starter kits from asp.net (
http://asp.net/Default.aspx?tabindex=9&tabid=47 ). I downloaded the
package, installed it, and chose to do a remote install for SQL
Server. As requested, I logged into our central SQL Server machine
(the same server as mentioned above) using Query Analyzer from my
workstation and ran the 3 SQL scripts to create the needed database. I
double checked the user login given by the program and I can login via
Query Analyzer just fine. Yet when I run the application in VS.NET or
just locally in IE, I get the "SQL Server does not exist or access
denied" error mentioned above. The few people that have been working
with this problem are stumped. We all think there is some security
setting that hasn't been set properly which isn't allowing me to
connect to the database via the code.

Also, we tried to run the application on a machine outside of the
domain and it worked fine. The database was found and connected to
without any issues. I'd really appreciate any feedback as this has
really crippled our Universities opportunity to experiment with .NET.
Jul 21 '05 #1
2 1577
you might want to check with
(a) the forums on www.asp.net - I think they have people there who do the
starter kits
(b) the newsgroup at microsoft.public.dotnet.framework.aspnet - this is a
bit closer than here.

It's usually pretty straightforward.
SQL allows 2 types of logins: Windows login, and SQL user/password.

Do you know which one the starter kit app is using?
If it is Windows login, have you setup ASPNET as an authorized user on SQL?
Have you verified the connection string points to the SQL server you think
it points to?

Using Query Analyzer - are you challenged for a user/password, or does your
SQL Server just allow you to connect without additional authentication? If
the latter, then it is using Windows login, and you need to enable the
ASPNET account, which is the Windows identity under which ASP.NET apps (like
the starter kit) run - you need to grant access to this identity to the
appropriate SQL serve databases and tables.
If the former, then you need to ensure this user/pw you use for QA is the
same one you use in the starter kit connection string. Typically this will
be provided in a config file, maybe it is in the web.config file for the
starterkit app. I don't know the starter kits, which is why I say "maybe".
web.config is a likely place for this info.

The other possibility is that the connection string is pointing to a bogus
server or a server where SQL is not running or not accessible. (maybe it is
"(local)" ). Check that as well.

--
Dino Chiesa
Microsoft Developer Division
d i n o c h @ O N L I N E . m i c r o s o f t . c o m
"Chris Stewart" <Co************@comcast.net> wrote in message
news:c3**************************@posting.google.c om...
We're having an issue here at school with trying to access a SQL
Server database from a .NET application. As a department, we roll out
a generic image to all of our lab computers. For some reason we were
getting "SQL Server does not exist or access denied" errors (
http://www.isy.vcu.edu/~cstewart/sqlerror.jpg ). One of the lab
machines in the lab worked fine and could connect without any issues.
As a quick fix, we re-imaged 3 of the machines that didn't work with
the one that did work. That resolved the issue for the current class
that needs to do this.

Today I went and downloaded one of the starter kits from asp.net (
http://asp.net/Default.aspx?tabindex=9&tabid=47 ). I downloaded the
package, installed it, and chose to do a remote install for SQL
Server. As requested, I logged into our central SQL Server machine
(the same server as mentioned above) using Query Analyzer from my
workstation and ran the 3 SQL scripts to create the needed database. I
double checked the user login given by the program and I can login via
Query Analyzer just fine. Yet when I run the application in VS.NET or
just locally in IE, I get the "SQL Server does not exist or access
denied" error mentioned above. The few people that have been working
with this problem are stumped. We all think there is some security
setting that hasn't been set properly which isn't allowing me to
connect to the database via the code.

Also, we tried to run the application on a machine outside of the
domain and it worked fine. The database was found and connected to
without any issues. I'd really appreciate any feedback as this has
really crippled our Universities opportunity to experiment with .NET.

Jul 21 '05 #2
sue
Are you using a firewall? We just had this same problem
and it was because SQL Server needed access on a
particular port and our firewall had blocked it.

-----Original Message-----
you might want to check with
(a) the forums on www.asp.net - I think they have people there who do thestarter kits
(b) the newsgroup at microsoft.public.dotnet.framework.aspnet - this is abit closer than here.

It's usually pretty straightforward.
SQL allows 2 types of logins: Windows login, and SQL user/password.
Do you know which one the starter kit app is using?
If it is Windows login, have you setup ASPNET as an authorized user on SQL?Have you verified the connection string points to the SQL server you thinkit points to?

Using Query Analyzer - are you challenged for a user/password, or does yourSQL Server just allow you to connect without additional authentication? Ifthe latter, then it is using Windows login, and you need to enable theASPNET account, which is the Windows identity under which ASP.NET apps (likethe starter kit) run - you need to grant access to this identity to theappropriate SQL serve databases and tables.
If the former, then you need to ensure this user/pw you use for QA is thesame one you use in the starter kit connection string. Typically this willbe provided in a config file, maybe it is in the web.config file for thestarterkit app. I don't know the starter kits, which is why I say "maybe".web.config is a likely place for this info.

The other possibility is that the connection string is pointing to a bogusserver or a server where SQL is not running or not accessible. (maybe it is"(local)" ). Check that as well.

--
Dino Chiesa
Microsoft Developer Division
d i n o c h @ O N L I N E . m i c r o s o f t . c o m
"Chris Stewart" <Co************@comcast.net> wrote in messagenews:c3**************************@posting.google. com...
We're having an issue here at school with trying to access a SQL Server database from a .NET application. As a department, we roll out a generic image to all of our lab computers. For some reason we were getting "SQL Server does not exist or access denied" errors ( http://www.isy.vcu.edu/~cstewart/sqlerror.jpg ). One of the lab machines in the lab worked fine and could connect without any issues. As a quick fix, we re-imaged 3 of the machines that didn't work with the one that did work. That resolved the issue for the current class that needs to do this.

Today I went and downloaded one of the starter kits from asp.net ( http://asp.net/Default.aspx?tabindex=9&tabid=47 ). I downloaded the package, installed it, and chose to do a remote install for SQL Server. As requested, I logged into our central SQL Server machine (the same server as mentioned above) using Query Analyzer from my workstation and ran the 3 SQL scripts to create the needed database. I double checked the user login given by the program and I can login via Query Analyzer just fine. Yet when I run the application in VS.NET or just locally in IE, I get the "SQL Server does not exist or access denied" error mentioned above. The few people that have been working with this problem are stumped. We all think there is some security setting that hasn't been set properly which isn't allowing me to connect to the database via the code.

Also, we tried to run the application on a machine outside of the domain and it worked fine. The database was found and connected to without any issues. I'd really appreciate any feedback as this has really crippled our Universities opportunity to
experiment with .NET.

.

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: David Sworder | last post by:
Hi, I'm developing an application that will support several thousand simultaneous connections on the server-side. I'm trying to maximize throughput. The client (WinForms) and server communicate...
2
by: Chris Stewart | last post by:
We're having an issue here at school with trying to access a SQL Server database from a .NET application. As a department, we roll out a generic image to all of our lab computers. For some reason...
6
by: Kevin Frevert | last post by:
In the process of learning VS2005/C# (having a background in Borland Delphi 2 through 2005) I came across an interesting feature of Visual Studio's file management. At first, it appeared there...
27
by: Frederick Gotham | last post by:
I thought it might be interesting to share experiences of tracking down a subtle or mysterious bug. I myself haven't much experience with tracking down bugs, but there's one in particular which...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.