1-
public void update(string id)
you writting a method by pasing one parameter as String Id
2-
string ids = Request.QueryString["ids"];
you storing value in 'ids' from QueryString that come from somewhere like you passing value from one page to another using QueryString
3-
Session["ID"] = ids.ToString();
you storing QueryString value in session
4- con.Open();
opening the connention by calling the connectionString value.
5-
SqlCommand cmd = new SqlCommand("select * from product where pro_id='" + ids + "'", con);
firing the Query and Storing in SQLCommant Property
6-
SqlDataReader dr = cmd.ExecuteReader();
executing the command using SQlDataReader. Data reader is read only one row and discard all other row
7-
if (dr.HasRows)
HasRows is used to check dr has row or not.if dr contain row then it will go inside the loop
8-
while (dr.Read())
{
txtpro_id.Text = dr["pro_id"].ToString();
txtpro_name.Text = dr["pro_name"].ToString();
txtdescription.Text = dr["description"].ToString();
txtpriority.Text = dr["priority"].ToString();
txtytubeurl.Text = dr["ytube_url"].ToString();
txtprice.Text = dr["price"].ToString();
}
setting the value to the control one by one
9-
dr.Close();
closing the datareader
10-
con.Close();
closing the connection