|
-
Nov 12th, 2009, 12:50 PM
#1
Thread Starter
Hyperactive Member
DataGridView reload
After adding a row into the DB i am using the following to show me the DGV containing recently added data but it is not showing up.
Code:
MWClientDataSet.Clear()
ClientProfileTableAdapter.Fill(MWClientDataSet.ClientProfile)
What should i do?
-
Nov 12th, 2009, 01:06 PM
#2
Addicted Member
Re: DataGridView reload
Need more info to go on.... Are you sure the new record has successfully being inserted into the database? Have you checked to make sure your fill has returned any/all records, what is the table record count before & afterwards. Also you are not showing the coding that binds your datatable to the dgv, are you sure this is set correctly and on the right dataset?
-
Nov 12th, 2009, 02:39 PM
#3
Thread Starter
Hyperactive Member
Re: DataGridView reload
Yes the record has successfully been inserted into the DB. The DGV is perfectly bound to the DataTable as i am using the second statement to populate it on Load. But once i have inserted the record into the DB, passing this command doesn't show up the new data. Even if new row is not of concern, the edited data is also not getting refreshed in DGV.
Is there any other way to do this?
-
Nov 12th, 2009, 02:44 PM
#4
Addicted Member
Re: DataGridView reload
Again, your coding is not showing how the data is being bound to the dgv or even if its the same dataset or not...
-
Nov 12th, 2009, 02:46 PM
#5
Thread Starter
Hyperactive Member
-
Nov 12th, 2009, 03:17 PM
#6
Hyperactive Member
Re: DataGridView reload
As long as the data is being saved, you do not need to reload the datagridview if the data is already in the datagridview.
The .CLEAR event "Clears the DataSet of any data by removing all rows in all tables.", so when you come to reload the the datagridview there is nothing there.
Computerman
It was much easier in VB6, but I am now liking Vb.Net alot more. 
-
Nov 12th, 2009, 04:06 PM
#7
Addicted Member
Re: DataGridView reload
If the data is saved as he said it was, the tables should be recreated and refilled showing the new data when he calls the fill. So this is not the problem
-
Nov 13th, 2009, 01:49 AM
#8
Thread Starter
Hyperactive Member
-
Nov 28th, 2009, 06:49 AM
#9
Thread Starter
Hyperactive Member
-
Nov 28th, 2009, 01:39 PM
#10
Hyperactive Member
Re: DataGridView reload
Can you show me your code for updating the dataset.
Computerman
It was much easier in VB6, but I am now liking Vb.Net alot more. 
-
Nov 28th, 2009, 11:27 PM
#11
Thread Starter
Hyperactive Member
Re: DataGridView reload
I am not using dataset to update my DB. I am using DataGridView only to show the records from DB. I am adding, editing the DB through other forms. What i am looking for is to refresh the DataGridView to show current data. Thats it!.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|