SQL Server does not exists or access denied
-
Hi friends, I am getting a strange error. I am working on .NET framework 1.1. When I work on a desktop application(C#.NET) and try to connect to SQL Server 2000 through my application, everything works fine and the connection is successfully established. But when I use the same database in web project(ASP.NET/C#), I am unable to connect to the database. I get an error: "SQL Server does not exists or access denied". I have carefully checked the connection string and everything in the code if perfect. Please help me out. Regards,
Sushant Duggal.
Paste your connection string here There may be some errors
Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com
-
Hi friends, I am getting a strange error. I am working on .NET framework 1.1. When I work on a desktop application(C#.NET) and try to connect to SQL Server 2000 through my application, everything works fine and the connection is successfully established. But when I use the same database in web project(ASP.NET/C#), I am unable to connect to the database. I get an error: "SQL Server does not exists or access denied". I have carefully checked the connection string and everything in the code if perfect. Please help me out. Regards,
Sushant Duggal.
Sushant Duggal wrote:
Hi friends, I am getting a strange error. I am working on .NET framework 1.1. When I work on a desktop application(C#.NET) and try to connect to SQL Server 2000 through my application, everything works fine and the connection is successfully established. But when I use the same database in web project(ASP.NET/C#), I am unable to connect to the database. I get an error: "SQL Server does not exists or access denied". I have carefully checked the connection string and everything in the code if perfect. Please help me out.
Are you using Windows Authentication or SQL authentication If you are using Windows auth, ASP.NET runs under an ASP.NET user and so that user needs to have permissions to your database.
Michael CP Blog [^] Development Blog [^]
-
Paste your connection string here There may be some errors
Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com
Hi I am using the same connection string for two projects. One is desktop application and other is web application. Desktop application is working fine, database connectivity is fine whereas I am unable to connect in web application. Still I am writing the connection string for ur reference. user id=sa;password=XXX;data source=XXX;initial catalog=XXX
Sushant Duggal.
-
Sushant Duggal wrote:
Hi friends, I am getting a strange error. I am working on .NET framework 1.1. When I work on a desktop application(C#.NET) and try to connect to SQL Server 2000 through my application, everything works fine and the connection is successfully established. But when I use the same database in web project(ASP.NET/C#), I am unable to connect to the database. I get an error: "SQL Server does not exists or access denied". I have carefully checked the connection string and everything in the code if perfect. Please help me out.
Are you using Windows Authentication or SQL authentication If you are using Windows auth, ASP.NET runs under an ASP.NET user and so that user needs to have permissions to your database.
Michael CP Blog [^] Development Blog [^]
Hi, I am using SQL authentication. I am using the same connection string for two projects. One is desktop application and other is web application. Desktop application is working fine, database connectivity is fine whereas I am unable to connect in web application. Still I am writing the connection string for ur reference. user id=sa;password=XXX;data source=XXX;initial catalog=XXX Regards,
Sushant Duggal.
-
Hi I am using the same connection string for two projects. One is desktop application and other is web application. Desktop application is working fine, database connectivity is fine whereas I am unable to connect in web application. Still I am writing the connection string for ur reference. user id=sa;password=XXX;data source=XXX;initial catalog=XXX
Sushant Duggal.
data source=XXX ? is it your local machine? What is the OS for database server ?
Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com
-
data source=XXX ? is it your local machine? What is the OS for database server ?
Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com
No data source is not on my machine. I am working in a network. It was working fine 1 month ago. From last month I was working on a desktopn application. But now I opened my previous project (web project) ans I discovered the error.
Sushant Duggal.
-
No data source is not on my machine. I am working in a network. It was working fine 1 month ago. From last month I was working on a desktopn application. But now I opened my previous project (web project) ans I discovered the error.
Sushant Duggal.
I dont have anything more to suggest. Anyhow Please visit this link and try to solve your problem http://support.microsoft.com/kb/328306[^]
Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com
-
I dont have anything more to suggest. Anyhow Please visit this link and try to solve your problem http://support.microsoft.com/kb/328306[^]
Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com
Thanks for your effort Sylvester Regards,
Sushant Duggal.
-
Hi, I am using SQL authentication. I am using the same connection string for two projects. One is desktop application and other is web application. Desktop application is working fine, database connectivity is fine whereas I am unable to connect in web application. Still I am writing the connection string for ur reference. user id=sa;password=XXX;data source=XXX;initial catalog=XXX Regards,
Sushant Duggal.
This is not an answer to your question, but rather a general comment. It is a bad idea to use the sa account as a general purpose access account. This account has special privileges which means that it can access and do things in your database that you really don't want to let outside users get access to. There is a security principle about reducing the attack surface which applies here. If you only want the login to be able to access stored procedures and perform C RUD functions, then you really should create a dedicated account for it and use this in the connection string instead. Sorry that I haven't answered your question, but I hope that this can help to remove what could end up being a security hole.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before. -
Hi I am using the same connection string for two projects. One is desktop application and other is web application. Desktop application is working fine, database connectivity is fine whereas I am unable to connect in web application. Still I am writing the connection string for ur reference. user id=sa;password=XXX;data source=XXX;initial catalog=XXX
Sushant Duggal.
Below is the correct syntax for both Web.config and Code Behind files. Web.config: ------------------------------------------------------------------- ------------------------------------------------------------------- Code Behind in your Application (C# example): ------------------------------------------------------------------- using System.Data.SqlClient; using System.Configuration; namespace YourNameSpaceHere { public class YourWebPageNameHere : System.Web.UI.Page { public string strConnString1 private void Page_Load(object sender, System.EventArgs e) { strConnString1 = ConfigurationSettings.AppSettings["ConnectionString1"]; { } } ------------------------------------------------------------------- NOTE: Now you are able to reference this connection string throughout your code. Let me know if this helps, Aaron S. Power Base Media