2011년 11월 11일 금요일

sqloledb connect problem invalid instance

A question: how many Sql Server instances have you on your computer ?


the IP address is corresponding to the computer. If you have several instances or if the db_instance_name is not the default value (SQLEXPRESS), it is difficult to resolve the full name of the instance (computer_name\db_instance_name) from the IP address
For me, the message is clear : invalid instance ==> the connection string does not contain the address of the instance.
Another possibility is the Sql Server Service of your instance is not using the port 1433 ( because of multiple instances for example )
if the port is 2449 ( for example ) you should use DataSource = tcp:192.168.42.1,2449 ( it is working for SqlConnection )
See the link :
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring(VS.80).aspx

댓글 없음: