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

Export to flat file

Hi There,
I am developing an windows application using VB.NET and I need to export and
open the contents of my datagrid to a flat file. Preferably txt or wordpad.

Whats the best direction/chunk of code to do this?

Thanks,
Kevin.
Jan 3 '08 #1
6 2864
"Kevin Humphreys" <kh********@hotmail.comwrote in
news:#v**************@TK2MSFTNGP04.phx.gbl:
I am developing an windows application using VB.NET and I need to
export and open the contents of my datagrid to a flat file. Preferably
txt or wordpad.

Whats the best direction/chunk of code to do this?
There is an open source library called "FileHelper" which can export to
CSV, Tab Delimited, etc.

SQL Server also supports file exporting... through DTS/SSIS.

--
sp**********@rogers.com (Do not e-mail)
Jan 4 '08 #2
Kevin,

Because you are talking about a DataGrid and not about a DataGridView, then
there is for sure a DataTable or DataSet as datasource.

The most simple is to save that as a XML file as

mydataset.WriteXML(path)

However you can as well loop through the tables and write a CSV or whatever.

Cor

Jan 5 '08 #3

"Kevin Humphreys" <kh********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Hi There,
I am developing an windows application using VB.NET and I need to export
and open the contents of my datagrid to a flat file. Preferably txt or
wordpad.

Whats the best direction/chunk of code to do this?

I don't know if this will put you in the ballpark. It just happens to be C#
and was in a Web solution. But it might give you a clue to get it to a file.
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
DataGrid1.RenderControl(hw);
Response.Write(sw.ToString());
Response.End();

Jan 5 '08 #4
There is an open source library called "FileHelper" which can export
to CSV, Tab Delimited, etc.
Can you provide a link please

tia
Wolf


Jan 5 '08 #5
Wolf Saenger <wo**********@web.dewrote in news:59706510ee38ca1db8b0cae190
@news.motzarella.org:
>There is an open source library called "FileHelper" which can export
to CSV, Tab Delimited, etc.

Can you provide a link please
http://filehelpers.sourceforge.net/
--
sp**********@rogers.com (Do not e-mail)
Jan 6 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Kajol | last post by:
Hi All, can u plz tell me how to import data from mysql to another database. & how to export data from anotherdata base to mysql Thanx for ur Advice Regards Kajol
1
by: Do Park via SQLMonster.com | last post by:
Hello all, I don?t often export data from a table. I am wondering how you export data from a table. I?d like to know how you export in real world. Do you export data from a table to a flat...
0
by: AJ2 | last post by:
Hi Guys, I included "for xml auto" in sql statement in "Excute SQL Task" and aimed to dump the output to a flat file. I added "ActiveX Script Task" into my package and with the following lines: ...
1
by: new | last post by:
I have data for each week in a single table. I need to export this data to a separate flat file for each week. Any ideas? DB2 SQL Query export to flat files as a function of data on each record
1
by: Swedge | last post by:
Hello I'm very new to using DB2, and would like to know about exporting the contents of a table to a flat file. For example, I have the following character string in a text field Craig Sweeney...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a question for you. I have a .csv file which has many lines of data. Each line has many data fields which are delimited by ",". Now I need to extract part of data from this...
3
by: Edward Reid | last post by:
OK, I've been watching my DB grow and have known for a long time I would have to move the back end, but of course I waited until I started getting odd behavior (at about 1.92GB). So today I...
2
by: paromitaroy | last post by:
I need to export data from db2 tables into flat files and import that in sql server 2000. The options I am getting for the flat files are : .ixf, .del and .wsf. But I need a .txt file or .xls flat...
6
by: ghjk | last post by:
I want to export oracle(version 9.2.0.1) database to a flat file. How can I do that? Is there any free tools for that? Found a tool called data loader but it is a commercial one.
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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:
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...

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.