473,395 Members | 1,639 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,395 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 1863

<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...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.