Dear all
I got that error when I was trying to connect to a server over IP
Object reference not set to an instance of an object.
the code for that
[CODE]
string connectionstr = string.Format(@ "Data Source=10.192.4 .154,1433;Initi al Catalog=maindat abase;Integrate d Security=True", listBox1.Select edItem.ToString ());
SqlConnection connection = new SqlConnection() ;
connection.Conn ectionString = connectionstr;
connection.Open ();
statusStrip1.It ems.Add("Connec tion Is Open");
connection.Clos e();
[CODE]
Any Ideas?
I got that error when I was trying to connect to a server over IP
Object reference not set to an instance of an object.
the code for that
[CODE]
string connectionstr = string.Format(@ "Data Source=10.192.4 .154,1433;Initi al Catalog=maindat abase;Integrate d Security=True", listBox1.Select edItem.ToString ());
SqlConnection connection = new SqlConnection() ;
connection.Conn ectionString = connectionstr;
connection.Open ();
statusStrip1.It ems.Add("Connec tion Is Open");
connection.Clos e();
[CODE]
Any Ideas?
Comment