I created a sql server instance called 'abcd' on my computer but when I try to connect to it I receive a strange error. I am able to connect to my others instances with the same code. Is the instance name causing this error?
Here is my code :
string connectionString = "Server=192.168.1.185\\abcd;" + "Database=test;" + "User ID=sa;" + "Password=bob;";
IDbConnection dbcon;
using (dbcon = new SqlConnection(connectionString))
{
dbcon.Open(); // <-- crashes here
Console.WriteLine("Connected");
}
Mono does not support names pipes or shared memory for connecting to SQL Server. Please enable the TCP/IP protocol.
What's wierd is that I'm able to connect to my other instances. The only thing that changes is the instance name.
I'm using Xamarin.iOS 9.4.0.0, Xamarin Studio 5.10.1, Mono Framework MDK 4.2.1.102
In SQL server the enabled protocols are configured on a per-instance basis, so the most likely explanation is that the named instance you're trying to connect to doesn't have the TCP/IP protocol enabled.
You can check this by opening the Sql Server Configuration Manager tool and going to SQL Server Network Configuration -> Protocols for {instance name}. Make sure that the TCP/IP protocol is enabled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With