46 thoughts on “GridView insert update delete in asp.net – Part 23

  1. Hi Venkat! but you pronounced the word "Footer" wrong! The way you said it was like "pootah" with 2 syllables? It should really be 1 syllable or 1 and 1/2, you have to use the full F sound at the start, ignore the double o sound, make it the short 'u' sound then TER. you place FAR too much emphasis on the double o sound and the initial F is compromised. British sometimes pronounce the final "-er" sound like the "ah" sound but theyre wrong. They would say the double o sound in the ordinary not the emphasized. You should say footer as 'fuhtr'. Saying footer with the double o as the long U sound is wrong. And you have to make the initial F sound clearly not a P or B sound

  2. Sir, please suggest that how can i do this through aspx.cs page because when i bind the data of gender it not accepted selectedvalue from .aspx pgge.It is request to u that please make a complete video on insert, update, delete, cancel.

  3. Thank you so much. I have an interview coming up, and they're testing me on this exactly. I can't believe how incredibly easy this is.

  4. I always enjoy your videos, Professor, but not for anything could I get this to work. After many internet searches, the following did work; setting the properties AppendDataBoundItems="true" and AutoPostBack="True" in the DDL. thoughts?

  5. how to connect database in webform on sqldatasource try to connect one window ask new connection i choose ms sqlserver after i give my database name and database engine name after connected they show the error

  6. I had some problems with the Insert function not working. I believe that it had to do with not using a "protected" access modifier. it works now. And, thank you, Professor Venkat. You are the best, simply the best. I have watched all your videos: C#, asp.net, ado.net and SQL Server. My career has been enhanced & enabled. I cannot thank you, enough.

  7. I tried this code so many times with using adapter/String etc.. but nothing happened and it has not shown to me any error message. Please solve my problem

    Code :

    con = new SqlConnection(@"Data Source=.SQLEXPRESS;Initial Catalog=mydb;Integrated Security=True");
    cmd = new SqlCommand("UPDATE tb1 SET name='" + TextBox1.Text + "', address='" + TextBox2.Text + "' WHERE id='" + Label2.Text +"'", con);

    Nothing happened.. Please Solve
    Email Id : [email protected]

  8. all the things are great but tell me one thing that you are writing all the queries related to database i-e insertion ,deletion etc in aspx file. Isn't that vulnerable ? I mean the user can see all your code and may change it.

  9. Thanks for this video sir, sir I want to know how to make two table join in one gridview and have crud operations in it

  10. Sir i am getting this error would you please help Sir
    [SqlException (0x80131904): Cannot insert the value NULL into column 'EmployeeId', table 'DemoForGridView.dbo.tblEmployee'; column does not allow nulls. INSERT fails.
    The statement has been terminated.]

    namespace DemoProjectsForGridView
    public partial class WebForm1 : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)


    protected void lbinsert_Click(object sender, EventArgs e)

    SqlDataSource1.InsertParameters["Name"].DefaultValue = ((TextBox)GridView1.FooterRow.FindControl("txtName")).Text;
    SqlDataSource1.InsertParameters["Gender"].DefaultValue = ((DropDownList)GridView1.FooterRow.FindControl("DropDownList2")).SelectedValue;
    SqlDataSource1.InsertParameters["City"].DefaultValue = ((TextBox)GridView1.FooterRow.FindControl("txtCity")).Text;

  11. And what if the query returns zero columns, in that case grid view control goes hidden.
    What should I do that the footer must be shown and works normal. ?
    (Looking forward to hear from you, soon)

  12. Getting this error
    'TextBox' does not contain a definition for 'Text' and no extension method 'Text' accepting a first argument of type 'TextBox' could be found (are you missing a using directive or an assembly reference?)
    Any comment will be helpful

  13. this is so useful man! you've just upgraded humanity in a whole new different level.. hope i could see you in person.. (im serious, im your number 1 fan)

  14. Severity Code Description Project File Line Suppression State
    Error 'ASP.default_aspx' does not contain a definition for 'GridView1_SelectedIndexChanged' and no extension method 'GridView1_SelectedIndexChanged' accepting a first argument of type 'ASP.default_aspx' could be found (are you missing a using directive or an assembly reference?)

    getting this error

  15. This was literally the easiest and the most efficient method anyone could have ever implemented. Thank you for sharing this with us. Helped Alot!

  16. Do you know how to persist GridView state after closing or restarting windows?. Because, when I close windows, its state is gone.

  17. I got NullReferenceException for integer textbox

    SqlDataSource3.InsertParameters["ftweldmet"].DefaultValue = ((TextBox)GridView1.FooterRow.FindControl("txtftweldmet")).Text;

Leave a Reply

Your email address will not be published. Required fields are marked *