error 26: SQL server locating error
-
Hi, In the runtime, when I need to make an SQL connection to my local DB, it gives an error like below: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connection. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) It is weird because I'm not using a remote database. My DB file is under the root directory of the program. Can anybody help? note: I'm pretty sure that my connection string is correct
-
Hi, In the runtime, when I need to make an SQL connection to my local DB, it gives an error like below: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connection. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) It is weird because I'm not using a remote database. My DB file is under the root directory of the program. Can anybody help? note: I'm pretty sure that my connection string is correct
-
Hi, In the runtime, when I need to make an SQL connection to my local DB, it gives an error like below: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connection. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) It is weird because I'm not using a remote database. My DB file is under the root directory of the program. Can anybody help? note: I'm pretty sure that my connection string is correct
-
well, I'm not sure, I just added a DB in my project, created some tables, and now trying to reach those tables as
SqlConnection conn = null;
conn = new SqlConnection("Data Source=|DataDirectory|\\MyDatabase.sfd");
conn.Open(); <---- this is where the error points -
Is the server running? Check all the services. Check if the user id and password you are providing has access to the database.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
I looked up the connection string from the app.config file and it did not have any connection parameters like id or password
"Data Source=|DataDirectory|\\MyDatabase.sfd"
I'm also not sure how to check these related services, as I explained to Covean, I added a DB to my project and I think it must have been running by default :/ -
Hi, In the runtime, when I need to make an SQL connection to my local DB, it gives an error like below: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connection. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) It is weird because I'm not using a remote database. My DB file is under the root directory of the program. Can anybody help? note: I'm pretty sure that my connection string is correct
Maybe this article helps: http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
-
Hi, In the runtime, when I need to make an SQL connection to my local DB, it gives an error like below: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connection. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) It is weird because I'm not using a remote database. My DB file is under the root directory of the program. Can anybody help? note: I'm pretty sure that my connection string is correct
-
Use a
SQLCeConnection
[^] instead of aSQLConnection
. You're connecting to a SQL CE database (*.sdf), not a SQL Server database (*.mdb). The latter one indeed requires a server :)I are Troll :suss:
oh this might be the solution :D YES IT IS! THANK YOU! :D and thanks to all others tried to help me :D
-
oh this might be the solution :D YES IT IS! THANK YOU! :D and thanks to all others tried to help me :D