I have following code on page load event:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
con = New Sq
I have connection:
Data Source=MyComputerName\SQL2012ENTERPRS;Initial Catalog=RESTFUL; User Id=myuser; Password=mypass123;
My server is : MyComputerName\SQL2012ENTERPRS
But since I use string, I add more \
so, at my code It will be:
public string connectionString = "Data Source=DAFWKN409C67Q\\SQL2012ENTERPRS;Initial Catalog=RESTFUL; User Id=rest_user; Password=rest_pwd_01;";
I have forgoten that I must remove one of \
since I am not use default string block, I use XML file to save my connection string. Then everything is ok. So, my suggestion is your instance name is not correct.
This is my connection string sample it I use local pc using SQL express:
string servername = @"Data Source=.\SQLExpress;Initial Catalog=Workshop;Integrated Security=True";
You should modify with your server name, and instance name by yourself, make sure it correct.