473,699 Members | 2,827 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1597
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.publi c.dotnet.framew ork.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.goo gle.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 #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.publi c.dotnet.framew ork.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.go ogle.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
2865
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 via a socket connection (no remoting, no ASP.NET). The client sends a message to the server that contains some instructions and the server responds in an asynchronous fashion. In other words, the client doesn't block while waiting for the...
2
266
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 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...
6
1405
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 wasn't a way for me to 'share' common business objects (ex. \Projects\Objects\Customer\CustomerObject.cs) across multiple solutions. When I select Add -> Existing Item, navigate to the directory, and select the .CS file and select Add, VS *copies*...
27
2332
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 comes to mind. I was writing usable which dealt with strings. As per usual with my code, I made it efficient to the extreme. One thing I did was replace, where possible, any usages of "strlen" with something like: struct PtrAndLen { char *p;
0
8687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8914
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8884
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7751
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6534
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.