468,544 Members | 1,738 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,544 developers. It's quick & easy.

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 2677
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 NPC403 | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.