string find = "select * from IBS_DC where DC_No = '" +a+ "'";
SqlCommand findquery = new SqlCommand(find, con);
SqlDataReader dr = findquery.ExecuteReader();
if (dr.Read())
{
cid = dr["Cust_Id"].ToString();
//dtpDate.Text = dr["Date"].ToString();
txtPono.Text = dr["PO_No"].ToString();
txtRemarks.Text = dr["Remarks"].ToString();
txtModeoftrans.Text = dr["Trans_Mode"].ToString();
txtVechileregno.Text = dr["Vechile_No"].ToString();
dtpDate.Value = Convert.ToDateTime(dr["DC_Date"]);
dtpPodate.Value = Convert.ToDateTime(dr["PO_Date"]);
sid = dr["Ship_Id"].ToString();
ssid = Convert.ToInt32(sid);
nodc = dr["DC_No"].ToString();
butInsert.Text = "UPDATE";
butDelete.Enabled = true;
butDcprint.Enabled = true;
}
else
{
butInsert.Text = "INSERT";
butDelete.Enabled = false;
butDcprint.Enabled = false;
}
dr.Close();
No comments:
Post a Comment