c# - get the combobox values from the row of the table and match -
hello friends making 1 window base application have struck somewhere thats why need experts. want value form row , match combobox.please find wrong in code. please make 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 * addcaasedetails"; sqldataadapter da = new sqldataadapter(str, con); dataset ds = new dataset(); da.fill(ds); (int = 0; < 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); } }
have check type casting or null condition check in dataset?. please brief it.
Comments
Post a Comment