SQL Connection Problem
-
Hello I've got a comboBox and I want to make a query after a change in the selected item is done. Inside the "comboBox1_SelectedIndexChanged" function, I wrote these:
string ogretisim;
ogretisim = comboBox1.Text;
SqlConnection conn = null;conn = new Sqlconnection("Data Source = Veritabani.sdf");
conn.Open()
conn.Close();I did not do the query yet, just to try. In the runtime, conn.Open() gives an error like it cannot reach the server. What can be the problem? note: I've tried all of these:
newSqlConnection("Data Source = baglanXXX");
newSqlConnection("Data Source = Veritabani.sdf");
newSqlConnection("Data Source = .\\Veritabani.sdf");
newSqlConnection("Data Source = VeritabaniDataSet.xsd");
newSqlConnection("baglanXXX");("baglanXXX" is my connection string) please someone help :(
-
Hello I've got a comboBox and I want to make a query after a change in the selected item is done. Inside the "comboBox1_SelectedIndexChanged" function, I wrote these:
string ogretisim;
ogretisim = comboBox1.Text;
SqlConnection conn = null;conn = new Sqlconnection("Data Source = Veritabani.sdf");
conn.Open()
conn.Close();I did not do the query yet, just to try. In the runtime, conn.Open() gives an error like it cannot reach the server. What can be the problem? note: I've tried all of these:
newSqlConnection("Data Source = baglanXXX");
newSqlConnection("Data Source = Veritabani.sdf");
newSqlConnection("Data Source = .\\Veritabani.sdf");
newSqlConnection("Data Source = VeritabaniDataSet.xsd");
newSqlConnection("baglanXXX");("baglanXXX" is my connection string) please someone help :(
-
try
new SqlConnection(@"Server = .\sqlexpress; database = YourDbName ; integrated security = sspi;");
-
Hello I've got a comboBox and I want to make a query after a change in the selected item is done. Inside the "comboBox1_SelectedIndexChanged" function, I wrote these:
string ogretisim;
ogretisim = comboBox1.Text;
SqlConnection conn = null;conn = new Sqlconnection("Data Source = Veritabani.sdf");
conn.Open()
conn.Close();I did not do the query yet, just to try. In the runtime, conn.Open() gives an error like it cannot reach the server. What can be the problem? note: I've tried all of these:
newSqlConnection("Data Source = baglanXXX");
newSqlConnection("Data Source = Veritabani.sdf");
newSqlConnection("Data Source = .\\Veritabani.sdf");
newSqlConnection("Data Source = VeritabaniDataSet.xsd");
newSqlConnection("baglanXXX");("baglanXXX" is my connection string) please someone help :(
-
Hello I've got a comboBox and I want to make a query after a change in the selected item is done. Inside the "comboBox1_SelectedIndexChanged" function, I wrote these:
string ogretisim;
ogretisim = comboBox1.Text;
SqlConnection conn = null;conn = new Sqlconnection("Data Source = Veritabani.sdf");
conn.Open()
conn.Close();I did not do the query yet, just to try. In the runtime, conn.Open() gives an error like it cannot reach the server. What can be the problem? note: I've tried all of these:
newSqlConnection("Data Source = baglanXXX");
newSqlConnection("Data Source = Veritabani.sdf");
newSqlConnection("Data Source = .\\Veritabani.sdf");
newSqlConnection("Data Source = VeritabaniDataSet.xsd");
newSqlConnection("baglanXXX");("baglanXXX" is my connection string) please someone help :(
thank you for replies, I'll work on it a bit further, thanks again =)