Sql Connection String Error  
Author Message
Ahmed EL Gendy





PostPosted: .NET Framework Data Access and Storage, Sql Connection String Error Top

hi all ,
i have a problem when i am trying to connect to the data base via Network or via Web.

this is my connection string :


static private string GetConnectionString()
{
return "Data Source=10.0.0.25\\SQLEXPRESS\\Databases\\FWR.MDF;Integrated Security=True;User Instance=True";

}


and i recive this error exption :

(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 connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified).

i want to know how to solve this error.



Best Regards

Ahmed EL Gendy



.NET Development10  
 
 
VMazur





PostPosted: .NET Framework Data Access and Storage, Sql Connection String Error Top

I believe Express version configured to disable remote connections. See next KB about how to resolve it

http://support.microsoft.com/kb/914277/en-us



 
 
William Vaughn





PostPosted: .NET Framework Data Access and Storage, Sql Connection String Error Top

Connecting to SQL Express can be problematic for the reasons that Val points out, but there are a lot of other issues as well. I think that SQL Express User Instance option can only work if the SQL Express instance is on the local system. To refer to this instance you should use the Shared Memory provider that does not accept an IP address.

Be sure to check out my blog for the article on connecting (see www.betav.com/blog/billva) or Chapter 9 of my HHG 7thEd.. It might help get you back on the right track.



 
 
iamunmad





PostPosted: .NET Framework Data Access and Storage, Sql Connection String Error Top

Try this:

Data Source=10.0.0.25\SqlExpress; Catelog=FWR; User Name=user name of the sql server; Password=password;

Before that configure the Sql Server to allow remote connections using Sql Server Surface Area Configuration Utility.

In addition using SSMS set the Authentication mode to Mixed Mode.

If you want to use integrated security then the remote pc must grant access to ur local system account as well as the Sql Server instance.