473,396 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 2836
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: JeffGoneMad | last post by:
Hi, I'm kind of a newbie to VB, so I hope this doesn't seem too trivial. I have a problem with the DataGridView control. I can find all kinds of stuff about populating data in a DataGridView...
10
by: Henok Girma | last post by:
Hello Gurus, I want to save the state of an unbound DataGridView on my Windows Form application to an XML file so i can later load it back.. Basically, on my form I have a DataGridView, it's got...
0
by: Diogo Alves - Software Developer | last post by:
Greetings Everyone! Here's my issue, I have a datagridview, and I'm already using currentCellChanged Event. What I want to do is... before the currentCellChanged, check if the user any...
6
by: alexia.bee | last post by:
Hi all, I am new to C# so please bear me :). I have an app which uses datagridview. it has 8 columns. I also have struct which has 8 members(the same as the datagridview). when I add row to...
1
by: Masterfrier | last post by:
Hi guys! I have a DataGridView populated from various textfiles. I need to be able to save the content from this datagridview as an XML file. How can this be done without using a dataset...
0
by: Cat | last post by:
Hi. What I am trying to do is very simple, but it somehow didn't work. I had created a table in a .MDB file, That table had 5 fields and one of which was the primary key. I added a DataGridView...
5
by: GS | last post by:
I Google search for answer to detected changes to the current row in detail view of a windows form ( not datagridview), so far I have not got the right search term to get me the answer, certainly I...
0
by: Ryan Liu | last post by:
I found DataGridView in .NET 2.0 has a bug, or maybe I used it in a wrong way, just try to confirm with you guys: I have a checkbox column in it, and a save button on the form try to save...
2
by: veer | last post by:
hi i want to save the value which i write in the datagridview cells how can i do actually i want to insert the value into the ms acees table by writting the values in gridview cells and then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.