try
{
if (comboBox1.SelectedIndex >= 0)
{
if (con.State == ConnectionState.Closed)
con.Open();
da = new SqlDataAdapter("select Student_Name, Father_Name from Admission where Admission_ID '" + comboBox1.SelectedValue + " '", con);
dt = new DataTable();
DataTable studentdatabase = new DataTable();
da.Fill(studentdatabase);
dataGridView1.DataSource = new BindingSource(studentdatabase, null);
con.Close();
}
else
{
MessageBox.Show("Select an Batch No");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
but following error
Incorrect syntax near 'hghgh '.
hghgh is my Admission_ID.