3
Answers

what i did wrong ??

Ask a question
zartin zaid

zartin zaid

11y
1.1k
1
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  {
  try
  {
  dataGridView1.Rows.Clear();
 
  SqlConnection con = new SqlConnection("Data Source=" + Settings.Default.db_ip + ";Initial Catalog=" + Settings.Default.db_name + ";User Id=" + Settings.Default.db_user + ";Password=" + Settings.Default.db_pass + ";");
  SqlDataAdapter tbCount = new SqlDataAdapter("USE " + Settings.Default.db_name + " SELECT * from'" + comboBox1.Text + "'", con);
  DataSet dt = new DataSet();
  tbCount.Fill(dt);
  this.dataGridView1.DataSource = dt.Tables[0];
}


please help

Answers (3)