Please check the code if it is correct please say ok
protected void btnEdit_Click(object sender, EventArgs e)
{
Button btn = (Button)sender;
string id = ddlarticleno.SelectedValue;
string sql = "select * from production_stock where id=" + id + "";
connection.Open();
SqlDataAdapter dap = new SqlDataAdapter(sql, connection);
DataTable dt = new DataTable();
dap.Fill(dt);
if (dt.Rows.Count > 0)
{
txtproductionorder.Text = dt.Rows[0]["production_order_no"].ToString();
ddlarticleno.SelectedValue = dt.Rows[0]["article_no"].ToString();
txtarticedescription.Text = dt.Rows[0]["article_desc"].ToString();
txtorderedqty.Text = dt.Rows[0]["order_qty"].ToString();
txtfinishedqty.Text = dt.Rows[0]["rec_Quantity"].ToString();
}

Debasis MohapatraRank #3,804 · 389 reputationPosted Dec 3, 2018, 10:29 PM EST
Debasis MohapatraRank #3,804 · 389 reputationPosted Dec 3, 2018, 10:31 PM EST
Sreekanth ReddyRank #726 · 3.2K reputationPosted Dec 3, 2018, 10:46 PM EST
Sreekanth ReddyRank #726 · 3.2K reputationPosted Dec 3, 2018, 10:49 PM EST
Debasis MohapatraRank #3,804 · 389 reputationPosted Dec 3, 2018, 10:59 PM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts