473,224 Members | 1,461 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,224 software developers and data experts.

Which file type to use to save data...

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
6 1853

<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

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

<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

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

<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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Paul C-T | last post by:
Hi, Am I trying to be too clever here? I am trying to write a PHP page to enable me to enter values into a form then write those values to a text file. I want to use the form & table that...
6
by: Don Grover | last post by:
How can I force a download of a csv file by user clicking on hyperlink. Don
4
by: JM | last post by:
Hi! I've worked hard to get my data into Excel from a bunch of text files. I've opened Excel and dumped the data in. I want to save the workbook/spreadsheet but have not set a file name yet in...
13
by: Hemant Sipahimalani | last post by:
The following piece of code is being used to export HTML to excel. HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"...
10
by: eggie5 | last post by:
Is it possible to get a file without using a form post? I want to get the data (bytes) of a file, text or binary, and just save it to a variable. Similar to the post body of a form that has a...
4
by: sufian | last post by:
Below is the field where user enters his/her email address and the AJAX post request is sent to the server and the user sees the message: echo("<div id=\"message\" class=\"success\">Thank you! You...
6
by: Milan Krejci | last post by:
while(list($key,$value) = each($_FILES)) { if(!empty($value)){ $filename = $value; $add = "upimg/$filename"; echo $_FILES; $error=copy($_FILES, $add); if (!$error)...
1
by: leninv | last post by:
Hi, I have a asp page where I have a Export to Excel button. When I click the button, I get the option to open or save or cancel. When I click on save option I get the save dialogue box and save it....
3
by: ArmageddonAsh | last post by:
I'm trying to make an application that will allow the user to enter data into a flexgrid (that's done) and then save the data from that flexgrid into a CSV file but even though the file is made none...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.