473,545 Members | 2,019 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1872

<al********@gma il.com????
news:11******** **************@ l12g2000cwl.goo glegroups.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********@gma il.com????
news:11******** **************@ l12g2000cwl.goo glegroups.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********@gma il.com????
news:11******** **************@ t46g2000cwa.goo glegroups.com.. .
>
Ryan Liu wrote:
<al********@gma il.com????
news:11******** **************@ l12g2000cwl.goo glegroups.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********@gma il.com????
news:11******** **************@ t46g2000cwa.goo glegroups.com.. .

Ryan Liu wrote:
<al********@gma il.com????
news:11******** **************@ l12g2000cwl.goo glegroups.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********@gma il.com????
news:11******** **************@ f1g2000cwa.goog legroups.com...
>
Ryan Liu wrote:
<al********@gma il.com????
news:11******** **************@ t46g2000cwa.goo glegroups.com.. .
>
Ryan Liu wrote:
<al********@gma il.com????
news:11******** **************@ l12g2000cwl.goo glegroups.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.WriteXm l 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********@gma il.comwrote in message
news:11******** **************@ l12g2000cwl.goo glegroups.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
3774
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 displays these fileds and values in different ways so am creating one page and parsing variables to it. The problem appears to be in trying to write...
6
18612
by: Don Grover | last post by:
How can I force a download of a csv file by user clicking on hyperlink. Don
4
4941
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 the coding. Running the below code I get a Dialog box that prompts for a file name and path. You know the usual. I don't want this. I want to...
13
13188
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" HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=ABC.xls") HttpContext.Current.Response.Write(strHTML) HttpContext.Current.Response.End() However when the user tries to...
10
2411
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 file input element in it. Ultimately what I want to do is get a file off client machine (that they specify) and send it to the server using a...
4
4642
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 have been successfully registered.</div>"); within 1.5 seconds. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
6
2700
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) $progressUploadingPhotos=false; $error=chmod($add,0777); if (!$error) $progressUploadingPhotos=false;
1
1559
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. I don't have any problem if I save it with .xls extension, but the problem comes when I save it with .TXT extension. When I open the file saved...
3
5801
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 of the data from the flexgrid goes into the CSV file and so I have a couple of questions. 1, How do I make the application load the data from a...
0
7656
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7808
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7423
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4945
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1884
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
704
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.