0

how do i display the inserted record in gridview in asp.net when i click on button..?

GridView1.DataSource = a.filldata("insert into student(Roll_no,Name,Age,Education,Mobile)values("+txtrollno.Text +",'"+txtname.Text +"',"+txtage.Text +",'"+txtedu.Text +"',"+txtmb.Text+")");
GridView1.DataBind();

i want it should be display right now at runtime record should be added....and displayed...
and i also get and error of "," i dont know how...and its of nonexecutequery()

update := GridView1.DataSource = a.filldata("update student set Roll_no="+txtrollno.Text +"where Roll_no=" + txtrollno.Text + ",Name='" + txtname.Text + "',Age=" + txtage.Text + ",Education='" + txtedu.Text + "',Mobile=" + txtmb.Text + ")");
GridView1.DataBind();

plzz help...

Edited by abhi1625: n/a

4
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by crishjeny
0

In my query's i do UPDATE X SET Y = '"+ blah.text + "',Z='" + bzla.text...... hope that helps a bit... more code would help me see better.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.