DataTable
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter();
SqlConnection con = new SqlConnection();
private
in form load i write following
this.Cursor = Cursors.WaitCursor;string constr = "Data Source=" + value1 + ";Initial Catalog=" + value2 + ";User ID=" + value3 + ";Password=" + value4 + "";con = new SqlConnection(constr);string comdstr = "select * from Driver1view";da = new SqlDataAdapter(comdstr, constr);ds = new DataSet();dt = new DataTable();
da.Fill(ds,"Driver"); dt = ds.Tables["Driver"]; totalrecord = dt.Rows.Count;this.Cursor = Cursors.Default; if (totalrecord > 0){
fillcontrol(); }else{MessageBox.Show("There is no records");}
{totalrecord = dt.Rows.Count; }Now my problem is when I want to show combobox in load form it not show and it give me errors why
}
Now my problem is when I want to show combobox in load form it not show and it give me
errors why
textBox1.Text = dt.Rows[currrecord]["DriverID"].ToString();
textBox2.Text = dt.Rows[currrecord]["DriverName"].ToString();
combobox.text = dt.Rows[currrecord]["NationalityName"].ToString();"
textBox4.Text = dt.Rows[currrecord]["Address"].ToString();"
label6.Text = currrecord+1 + "of"+ totalrecord.ToString();