By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,960 Members | 2,246 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,960 IT Pros & Developers. It's quick & easy.

datagridview refresh

P: n/a
M K
I have added a record to the underlying db and after I add the record i do a
datagridview.Refresh(); and i dont see the newly added record.

If i stop and start the application its there. What am I doing or not
doing?

Mark
Jul 10 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
datagridview.Refresh() redraws the grid-view from the data source
(presumably a DataSet in your case); it doesn't reload the DataSet
from the database. You may have to Clear() and Fill() the DataTable
(or DataSet).

Marc

Jul 11 '07 #2

P: n/a
M K
I found the .Clear() method but not the .Fill() method on the dataset.

I have the following:
Dataset
BindingSource
TableAdapter

"Marc Gravell" <ma**********@gmail.comwrote in message
news:11**********************@o61g2000hsh.googlegr oups.com...
datagridview.Refresh() redraws the grid-view from the data source
(presumably a DataSet in your case); it doesn't reload the DataSet
from the database. You may have to Clear() and Fill() the DataTable
(or DataSet).

Marc

Jul 11 '07 #3

P: n/a
M K
uggg i finally figured it out..

DataSet1.GetChanges();

TableAdapter.Fill(DataSet1.table);

thanks for pointing me in the right direction :)

"M K" <sk********************@yahoo.comwrote in message
news:%J*****************@newsread3.news.pas.earthl ink.net...
>I found the .Clear() method but not the .Fill() method on the dataset.

I have the following:
Dataset
BindingSource
TableAdapter

"Marc Gravell" <ma**********@gmail.comwrote in message
news:11**********************@o61g2000hsh.googlegr oups.com...
>datagridview.Refresh() redraws the grid-view from the data source
(presumably a DataSet in your case); it doesn't reload the DataSet
from the database. You may have to Clear() and Fill() the DataTable
(or DataSet).

Marc


Jul 11 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.