hello friends i am making one window base application now i have struck somewhere thats why i need help from you experts. i want to get value form the row and match from the combobox.please find where i am wrong in this code. please make it crrect
private void btnadd_Click(object sender, EventArgs e)
{
try
{
con = new SqlConnection("Data Source=.;Initial Catalog=DSIIDC2;Integrated Security=True");
con.Open();
string str = "select * from addcaasedetails";
SqlDataAdapter da = new SqlDataAdapter(str, con);
DataSet ds = new DataSet();
da.Fill(ds);
for (int i = 0; i < ds.Tables["addcaasedetails"].Rows.Count; i++)
{
if (ds.Tables["addcaasedetails"].Rows[i]["caseno"] == casedetails.ValueMember)
{
dataGridView1.Visible = true;
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}