Click here to Skip to main content
15,905,232 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
hello friends i am making one window base application
now i have struck somewhere thats why i need help from you experts.

C#
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);
}


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
Posted
Updated 31-May-15 22:10pm
v2
Comments
[no name] 1-Jun-15 2:53am    
what exactly you want to do .
explain in details so that any one can help you.

1 solution

C#
if (ds.Tables["addcaasedetails"].Rows[i]["caseno"].ToString() == casedetails.ValueMember)
{
  dataGridView1.Visible = true;
}

if its not working then let me know
 
Share this answer
 
Comments
faizyab 2009 1-Jun-15 5:18am    
thank you !!!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900