471,322 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,322 software developers and data experts.

Save Row in DataGridView

Hi, how i can save the rows in a DataGridView in c# 2008?
i haven't a DB but only datagridview...
Jun 27 '08 #1
4 2754
Well, what is the data? And in what format do you want to save it?

Marc
Jun 27 '08 #2
Christian wrote:
Hi, how i can save the rows in a DataGridView in c# 2008?
i haven't a DB but only datagridview...
I think the only thing you can do it iterate over the Rows collection of
the DataGridView and do something with each row in turn, where
"something" really depends on what you're trying to achieve.

You could push the data in to DataTable - which to be honest is a better
place to keep it in the first place; you can back your DataGridView with
a DataTable directly, by binding it via the DataSource property.

DataTable implements the ISerializable and IXmlSerializable interfaces,
so you can use their respective methods (GetObjectData() and WriteXml())
to store the data to disk.

--
Chris Crowther MBCS
C# Developer
RHD Research Ltd
Jun 27 '08 #3
On 15 Apr, 15:55, Marc Gravell <marc.grav...@gmail.comwrote:
Well, what is the data?
the data is a collection of my DVD; title, Director, Genre, ecc...

And in what format do you want to save it?
the format is text; i create an interface to insert a DVD
information....
it's difficult to create this program?

Jun 27 '08 #4
As Chris notes, using a DataTable is a simple option, as a DataTabe is
easy to bind to a DataGridView, and easy to load/save (especially as
xml). There are plenty of other approaches, but this should work very
quickly and easily.

Marc
Jun 27 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Henok Girma | last post: by
reply views Thread by Diogo Alves - Software Developer | last post: by
6 posts views Thread by alexia.bee | last post: by
5 posts views Thread by GS | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.