protected void Button5_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection();
int cmy_id = 0;
cmy_id = Convert.ToInt32(Request.QueryString["@cmy_id"].ToString());//Object reference not set to an instance of an object. error are display
if (!IsPostBack)
{
sel();
}
}
void sel()
{
string select = "select * from companydetail";
SqlCommand cmd = new SqlCommand(select, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
con.Close();
DataSet ds = new DataSet();
da.Fill(ds);
foreach (GridViewRow gvrow in GridView1.Rows)
{
CheckBox chck = gvrow.FindControl("CheckBox1") as CheckBox;
if (chck.Checked)
{
TextBox6.Text = ds.Tables[0].Rows[0][1].ToString();
}
}

Manikandan MurugesanRank #300 · 8.4K reputationPosted Jun 22, 2017, 11:15 PM EDT
Pradeep YadavRank #478 · 5.2K reputationPosted Jun 25, 2017, 7:40 AM EDT
Vivek KumarRank #272 · 9.3K reputationPosted Jun 25, 2017, 2:19 PM EDT