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 / Windows Forms / WinForm General / November 2006

Tip: Looking for answers? Try searching our database.

New to 2.0 question: How do you make a DataGridView comit changes?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RMZ - 13 Nov 2006 18:49 GMT
Using the Visual Studio.NET 2005 designer, I have a grid bound data a
DataBindingSource, no code was written, I just used the VS.NET provided
tools to set up three columns and I have the DataGridView acting by
default so I can delete rows and edit the contents of the grid.

To perform the update/comit to the database, I put a new button on the
form when it's clicked I call
dataGridView1.EndEdit(); this does not update the database.

Is there anything more I should be doing?

The database in this case is a Microsoft Access database. Using OleDb.
Bart Mermuys - 13 Nov 2006 19:45 GMT
Hi,

> Using the Visual Studio.NET 2005 designer, I have a grid bound data a
> DataBindingSource, no code was written, I just used the VS.NET provided
[quoted text clipped - 6 lines]
>
> Is there anything more I should be doing?

Validate();
yourBindingSource.EndEdit();
yourTableAdapter.Update(yourDataSet.yourDataTable);

If you use the Data Sources window ( Menu->Data->Show Data Sources ) and
then drag a DataSource on the Form it will create all required code.

HTH,
Greetings

> The database in this case is a Microsoft Access database. Using OleDb.

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.