zartin zaid

zartin zaid

  • NA
  • 1
  • 1.3k

what i did wrong ??

Jul 18 2013 7:25 PM
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)