Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / July 2007

Tip: Looking for answers? Try searching our database.

datagridview refresh

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
M K - 11 Jul 2007 00:15 GMT
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
Marc Gravell - 11 Jul 2007 05:21 GMT
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
M K - 11 Jul 2007 14:15 GMT
I found the .Clear() method but not the .Fill() method on the dataset.

I have the following:
Dataset
BindingSource
TableAdapter

> 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
M K - 11 Jul 2007 14:22 GMT
uggg i finally figured it out..

DataSet1.GetChanges();

TableAdapter.Fill(DataSet1.table);

thanks for pointing me in the right direction :)

>I found the .Clear() method but not the .Fill() method on the dataset.
>
[quoted text clipped - 9 lines]
>>
>> Marc

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.