7
Answers

invalid colum name

ta mu

ta mu

10y
1k
1
i am using this code but at  da.fill(dt) i got error "invalid colum name a"  this a  is user name and exist in database.  this is a desktop application



 private void comboBox1_SelectedValueChanged(object sender, EventArgs e)
  {
   

  if ( comboBox1.SelectedItem.ToString() == "Name")
  {
 
  SqlConnection my = new SqlConnection(@"Data Source=heaven_prince20;Initial Catalog=final_pr;Integrated Security=True");
  my.Open();
  DataTable dt = new DataTable();
  SqlDataAdapter da = new SqlDataAdapter("Select * from addcustomer where name= " +
  textBox1.Text + "", my);
  da.Fill(dt); ......................................error


  }

  else


  {
  MessageBox.Show("error");

  }
Answers (7)