Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In My VB.NET Program, Problem is with two forms :

1. Display Accounts
2. Add New Accounts

In "Display Accounts", I have a Sub-Routine named "RefreshData" which gets data from MS Access Database into DataAdapter>DataSet>DataGridView.

From "Add New Accounts", I called the Sub-Routine "display_accounts.RefreshData" after adding new Account to Database.

So, It should display the newly added account in DataGridView of "Display Accounts".

Code Skelton in "Add New Accounts" is :

-Insert into Database
-Call : display_accounts.RefreshData

Code Skelton in "Display Accounts" is :

Select Command to Select from Database
Getting Data into DataAdapter
Clearing DataSet
Filling Data into DataSet from DataAdapter
Setting DataSource of DataGridView to DataSet
Refreshing DataGridView

Problem is DataGridView not displayed newly added record.
Posted

1 solution

This seems abstract. It might not possible. You can send code block.
You can do one thing each time fill Data Set create a new instance or you can make it null
before fill.
 
Share this answer
 
Comments
jenitshah 16-Aug-13 2:23am    
I make my DataSet Null each time before fill It. Using ds.clear() where ds is DataSet.
Mukesh Ghosh 16-Aug-13 2:43am    
Send me your code block

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900