.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sandeep Singh
Melody Anderson
Eminent IT

Home >> Forum >> VB.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Auto update in datagridview control using vb.net

Posted By: srini     Posted Date: January 10, 2011    Points:2   Category :VB.Net

I am developing one application using vb.net and SQL server 2005. I have some fields like productID,prodname and quantity. I have used insert query to insert the values into the database.

I used datagridview control in the main form itself to show the details,what i entered into textboxes.

If i close the application and open it again, I can see the data's what i entered finally.

Now i need, I want to update the gridview values, once i click the "save" button without closing and opening the form.

Author: Manas Patnaik             
Posted Date: January 10, 2011     Points: 5   

Hi Sirin

Where you are assigning your DataSource to the Grid View?

If its in pageload make sure that it fires everytime the page load.Be Sure that the Data Retrival code is outside !IsPostBack condition.

Once a save button Clicked The codebehind logic for the Button will get fired and Then page Load ,whcih will fetch you the required updates.

Manas Patnaik
Author: Asha.MP             
Posted Date: January 12, 2011     Points: 5   


In the save button click event just bind the data to the gridview again. this will inialize the gridview again so that the grid will update.

Thanks and Regards,

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend