Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

sql network server

$
0
0

 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

 

string connectionstr = string.Format(@"Data Source=10.192.4.154,1433;Initial Catalog=maindatabase;Integrated Security=True", listBox1.SelectedItem.ToString());
            SqlConnection connection = new SqlConnection();
            connection.ConnectionString = connectionstr;
            connection.Open();
            statusStrip1.Items.Add("Connection Is Open");
            connection.Close();

 Any Ideas?


little83

Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>