Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
i have select for gridview data showing textbox.
deva asir
Jun 23 2017 1:55 AM
246
Reply
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();
}
}
Attachment:
new_project.zip
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
System.Data.SqlClient.SqlException: Incorrect syntax near ',
pressing the enter to add row of table in jquary.