ta mu

ta mu

  • NA
  • 201
  • 81.8k

invalid colum name

Jul 24 2013 5:47 AM
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)