SQL Server does not exist or access denied

jmjyiannis

Member
Joined
Jun 27, 2004
Messages
16
Programming Experience
Beginner
Good morning everyone.

I have installed .NET and SQL Server 2000 but when I try to run any project, it stops and shows the message "SQL Server does not exist or access denied".
However, the .NET connects with the SQL SERVER because I can see all the tables or the stored procedures of the databases, and retrieve data from tables.

I have a completed ASP.NET project which used to run fine in another mashine but it shows the same problem running at this mashine.


What should I do?????
please.................any suggestions?????
 
Try this

go to Microsoft SQL Server folder in Program Files and right click Properties. in Security tab add asp.net user to user names list and grant full control to asp.net user.

Or check your connection string:

data source=SERVERNAME;persist security info=False;initial catalog=DATABASE;user id=sa;password=password;
 
The connection string that I have is:
server=e511-eke;Integrated Security=SSPI;database=FLS;

and the authentication of the SQL server is "windows only"This used to work fine. But not in this mashine.
 
Actually, this exception can be caused by many factors including slammer worm ... :(

However, if you keep your authentication Windows based, then you need to make sure that the Windows user has the appropriate access rights for whatever you're trying to do.

Try connecting to your database with a trusted connection like:
connString= "Data Source=Instance;Initial Catalog=DB; Integrated Security=SSPI;"
If i doesn't work that way, try with giving as a data source the: "serverName\Instance Name" as if you have installed both sql server and vs .net on the same pc ... and if you do add alias with the same name(s) as your local sql server instance(s), vs .net will treat it (them) as remote server(s) hence failed to connect.

Btw, you didn't mention about SP2 (have you SP2 on that machine?) as it can cause the issue too
Also to connect through IP address and add Trusted_Connection=true


I'm waiting for your feedback ... Cheers ;)
 
So, first of all the SQL server and .net are in the same mashine. It is has win 2000 server for OSystem.

Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Data Source=E511-EKE;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=E511-EKE;Use Encryption for Data=False;Tag with column collation when possible=False;Initial Catalog=dissertation_FLS;
this is my connection string when .net connects with sql server. As I said it used to work fine in another mashine.

aspnet user is registered in the sqlserver and has full access in the specific database and in the folder of sql server in Program files.

webconfig has in the sessionstate:
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"


it sounds complicated..... I know.....:-(
 
Finally, the problem was that the connection string was unable to connect the database with .NET out of the ASP.NET environment. the connection string should have been.....

"Data Source=127.0.0.1;Initial Catalog=dissertation_FLS;integrated security=SSPI;"

instead of

"server=e511-eke;Integrated Security=SSPI;database=disseration_FLS;"


and the webconfig should be.....

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;"
cookieless="false" timeout="20"

>

without the trusted connection

thank you kulrom for your support
 
Back
Top