SqlConnection con1 = new SqlConnection(ConfigurationManager.ConnectionStrings["GVRAgencyConnectionString1"].ConnectionString);
con1.Open();
SqlDataAdapter da = new SqlDataAdapter("select weight,mrp_pack,no_of_pack,mrp_master_pack from dbo.purchase_order where product_ID=@product_ID",con1);
da.SelectCommand.Parameters.AddWithValue("@product_ID", DropDownList3.Text);
DataTable dt = new DataTable();
da.Fill(dt);
con1.Close();
DataRow row = dt.Rows[0];
txtwgt.Text = row["weight"].ToString();
txtmrpsinglepack.Text = row["mrp_pack"].ToString();
txtnoofmasterpack.Text = row["no_of_pack"].ToString();
txtmrpmaster.Text = row["mrp_master_pack"].ToString();
SqlConnection con1 = new SqlConnection(ConfigurationManager.ConnectionStrings[GVRAgencyConnectionString1].ConnectionString); con1.Open(); SqlDataAdapter da = new SqlDataAdapter(select weight,mrp_pack,no_of_pack,mrp_master_pack from dbo.purchase_order
Share
1) try this :
2)welcome to StackOverFlow.
3) you cant move to live with some girl if you dont have a girl.
Same here – you cant touch with records in datatable withindex 0 if you dont know that you already have rows in index 0.