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


Top 5 Contributors of the Month
david stephan

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
Hi,

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.


Responses
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
http://manaspatnaik.com/blog
Author: Asha.MP             
Posted Date: January 12, 2011     Points: 5   

Hi..

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,
Asha.mp


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
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

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