By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,880 Members | 2,443 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,880 IT Pros & Developers. It's quick & easy.

Which file type to use to save data...

P: n/a
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 the gridview, i add the same data to this staruct and
then add this struct instance to a list.

the app creates more then one file with different name. depending on
the user.

I need to save all the list to a file. I also need to be able to copy
the content of this file and to present it in the grid view. there are
no rules for the read file. I always load the entire file to the list
and vice versa.

I was thinkking to use Access(mdb) or excell(xls) to save the content.
which one do you think i should use?

Thanks,
Alexia

Dec 16 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a

<al********@gmail.com????
news:11**********************@l12g2000cwl.googlegr oups.com...
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 the gridview, i add the same data to this staruct and
then add this struct instance to a list.

the app creates more then one file with different name. depending on
the user.

I need to save all the list to a file. I also need to be able to copy
the content of this file and to present it in the grid view. there are
no rules for the read file. I always load the entire file to the list
and vice versa.

I was thinkking to use Access(mdb) or excell(xls) to save the content.
which one do you think i should use?

Thanks,
Alexia
What about csv file(properly escaped), or xml/html(<table/>, <tr/<td/>)
file if it is purely used as data repository at the backend?

Ryan
Dec 16 '06 #2

P: n/a

Ryan Liu wrote:
<al********@gmail.com????
news:11**********************@l12g2000cwl.googlegr oups.com...
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 the gridview, i add the same data to this staruct and
then add this struct instance to a list.

the app creates more then one file with different name. depending on
the user.

I need to save all the list to a file. I also need to be able to copy
the content of this file and to present it in the grid view. there are
no rules for the read file. I always load the entire file to the list
and vice versa.

I was thinkking to use Access(mdb) or excell(xls) to save the content.
which one do you think i should use?

Thanks,
Alexia

What about csv file(properly escaped), or xml/html(<table/>, <tr/<td/>)
file if it is purely used as data repository at the backend?

Ryan
Hi Ryan,

thanks for your reply,

I was thinking to write to excel file. but when i try to retrieve the
number of rows it gives me 65000, which is right. but only 6 rows are
used.

Is there anything i can do?

Dec 16 '06 #3

P: n/a

<al********@gmail.com????
news:11**********************@t46g2000cwa.googlegr oups.com...
>
Ryan Liu wrote:
<al********@gmail.com????
news:11**********************@l12g2000cwl.googlegr oups.com...
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 the gridview, i add the same data to this staruct
and
then add this struct instance to a list.
>
the app creates more then one file with different name. depending on
the user.
>
I need to save all the list to a file. I also need to be able to copy
the content of this file and to present it in the grid view. there are
no rules for the read file. I always load the entire file to the list
and vice versa.

>
I was thinkking to use Access(mdb) or excell(xls) to save the
content.
which one do you think i should use?
>
Thanks,
Alexia
>
What about csv file(properly escaped), or xml/html(<table/>, <tr/>
<td/>)
file if it is purely used as data repository at the backend?

Ryan

Hi Ryan,

thanks for your reply,

I was thinking to write to excel file. but when i try to retrieve the
number of rows it gives me 65000, which is right. but only 6 rows are
used.

Is there anything i can do?
Well, I don't quite follow you. Do you mean there are 65000 rows in
datagrid, but you only care 6 rows, and you only want to export and save
these 6 lines?

-Ryan
Dec 17 '06 #4

P: n/a

Ryan Liu wrote:
<al********@gmail.com????
news:11**********************@t46g2000cwa.googlegr oups.com...

Ryan Liu wrote:
<al********@gmail.com????
news:11**********************@l12g2000cwl.googlegr oups.com...
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 the gridview, i add the same data to this staruct
and
then add this struct instance to a list.

the app creates more then one file with different name. depending on
the user.

I need to save all the list to a file. I also need to be able to copy
the content of this file and to present it in the grid view. there are
no rules for the read file. I always load the entire file to the list
and vice versa.

I was thinkking to use Access(mdb) or excell(xls) to save the
content.
which one do you think i should use?

Thanks,
Alexia

>
What about csv file(properly escaped), or xml/html(<table/>, <tr/>
<td/>)
file if it is purely used as data repository at the backend?
>
Ryan
Hi Ryan,

thanks for your reply,

I was thinking to write to excel file. but when i try to retrieve the
number of rows it gives me 65000, which is right. but only 6 rows are
used.

Is there anything i can do?

Well, I don't quite follow you. Do you mean there are 65000 rows in
datagrid, but you only care 6 rows, and you only want to export and save
these 6 lines?

-Ryan
yes.

By default, the are 65000 lines in excel.

Dec 17 '06 #5

P: n/a

<Er********@gmail.com????
news:11**********************@f1g2000cwa.googlegro ups.com...
>
Ryan Liu wrote:
<al********@gmail.com????
news:11**********************@t46g2000cwa.googlegr oups.com...
>
Ryan Liu wrote:
<al********@gmail.com????
news:11**********************@l12g2000cwl.googlegr oups.com...
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 the gridview, i add the same data to this
staruct
and
then add this struct instance to a list.
>
the app creates more then one file with different name. depending
on
the user.
>
I need to save all the list to a file. I also need to be able to
copy
the content of this file and to present it in the grid view. there
are
no rules for the read file. I always load the entire file to the
list
and vice versa.
>
>
>
I was thinkking to use Access(mdb) or excell(xls) to save the
content.
which one do you think i should use?
>
Thanks,
Alexia
>

What about csv file(properly escaped), or xml/html(<table/>, <tr/>
<td/>)
file if it is purely used as data repository at the backend?

Ryan
>
Hi Ryan,
>
thanks for your reply,
>
I was thinking to write to excel file. but when i try to retrieve the
number of rows it gives me 65000, which is right. but only 6 rows are
used.
>
Is there anything i can do?
>
Well, I don't quite follow you. Do you mean there are 65000 rows in
datagrid, but you only care 6 rows, and you only want to export and save
these 6 lines?

-Ryan

yes.

By default, the are 65000 lines in excel.
Sorry, I guess you are using some office driver or API, which I am not
familiar.

I always try to avoid use such drivers. I'd rahter use XHTML or csv, which
is more portable and you can have total control.

BTW, csc and xthml file can be open by excel. Or you can even just change
file ext to xls.

Ryan
Dec 17 '06 #6

P: n/a
Hi Alexia,

You could create a strong-typed DataSet to hold your data in memory. To
load data into the DataSet create an instance and call one of the
DataSet.ReadXml method overloads. To save the data simply call one of the
DataSet.WriteXml method overloads.

"Data Access in Client and Middle-Tier Programming
How to: Create a Typed Dataset"
http://msdn2.microsoft.com/en-us/lib...hb(vs.80).aspx

You can then bind the DataGridView directly to your DataSet.

"Data Access in Client and Middle-Tier Programming
Displaying Data Overview
BindingSource Component; DataGridView Control"
http://msdn2.microsoft.com/en-us/lib...9b(VS.80).aspx

--
Dave Sexton

<al********@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
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 the gridview, i add the same data to this staruct and
then add this struct instance to a list.

the app creates more then one file with different name. depending on
the user.

I need to save all the list to a file. I also need to be able to copy
the content of this file and to present it in the grid view. there are
no rules for the read file. I always load the entire file to the list
and vice versa.

I was thinkking to use Access(mdb) or excell(xls) to save the content.
which one do you think i should use?

Thanks,
Alexia

Dec 18 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.