i have 4 (Textbox ClientID, Name ,Address ,CellphoneNO) and one Combo Box Having OrderID
First the Query Run Using Clint ID that Return Some Data from Clienttable and some from Order Table
Client may has Many Orders but there's only one details Shown when query run Beacase i don't have to use Datagrid
in the Order combobox id are Shown of different order
so i want to select id from Order combo box to further search the datareader for remaing orders that are not shown and the result of a form sudden change and show records in the textboxes of Name ,address,etc
SqlConnection conn = new SqlConnection("Server= localhost; database=tailoringmng; integrated Security=true");
string proce = procstr;
SqlCommand cmd = new SqlCommand(proce,conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter(dbpar,dbtype)).Value=searchkey;
SqlDataAdapter da = new SqlDataAdapter(cmd);
SqlDataReader reader = reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
if (reader.HasRows)
{
int rowcount = 0;
while (reader.Read())
{
rowcount++;
txtid.Text = reader["ClientID"].ToString();
txtname.Text = reader["Name"].ToString();
txtmobile.Text = reader["Mobile"].ToString();
txtcity.Text = reader["city"].ToString();
txtaddress.Text = reader["address"].ToString();
cmborderid.Items.Add(reader["orderId"].ToString());
tsddate.Text = reader["DDate"].ToString();
lbddayleft.Text = reader["Days_Left"].ToString();
ttstatus.Text = reader["Status"].ToString();conn.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
when i call this function All the Textboxs are Fill with data but when i select a value from order id combobox at run time nothing change value remain the same ...what's the solution