473,395 Members | 1,460 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.

How to store data retrieved from sql DB into a file

Hey guys,


I am stuck at a point at this stage. I have made an application that shows data from sql server DB.
Now, I want to make a change. The change is that whatever data is being displayed in datagrid view,
i should b able to store it in a file. It can be a simple document file or a pdf or excel.
Do you have any suggestions on how can i do it?



Thanks
Ajinkya
Mar 17 '11 #1

✓ answered by Aimee Bailey

If you are using the DataTable to display data on a DataGridView, the DataTable hosts a WriteXML method. However if you wish to write a more readable format, you will need to write a custom method yourself. Possibly the easiest is to create a CSV file by iterating over the rows and columns, this would mean you could open the file you save in Microsft Excel and other spreadsheet apps.

All the best.

Aimee.

1 1524
Aimee Bailey
197 Expert 100+
If you are using the DataTable to display data on a DataGridView, the DataTable hosts a WriteXML method. However if you wish to write a more readable format, you will need to write a custom method yourself. Possibly the easiest is to create a CSV file by iterating over the rows and columns, this would mean you could open the file you save in Microsft Excel and other spreadsheet apps.

All the best.

Aimee.
Mar 20 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Karen Grube | last post by:
Hi! Each week, we receive a two-page PDF file from UPS along with a separate flat file (a CSV) The PDF file contains the overview of our weekly invoice and the CSV contains the details of each...
14
by: Luiz Antonio Gomes Pican?o | last post by:
How i can store a variable length data in file ? I want to do it using pure C, without existing databases. I'm thinking to use pages to store data. Anyone has idea for the file format ? I...
3
by: psbasha | last post by:
Hi , When ever we read any data from file ,we read as a single line string ,and we convert the respective field data available in that string based on the data type ( say int,float ). ...
1
by: inamul | last post by:
I want to select CheckBox based on data retrieved from mysql database table. Could anyone show me the simple way of doing it. Data store in table under colum "sectionOfInterest" is shown below...
1
by: hellboss | last post by:
Hi ! im workin with the SQL server05, i want to store a document file as it is into a field in my database. Some may suggest to extracting the text from the doc file to an array and passing it to...
3
by: almo | last post by:
hi guys, I have question about writing a function that will store some data from a file in an array, then when that function is call in main, I can use that array in the main() for calculation. Here...
4
by: carmelo | last post by:
Hi! I need to read and store data from a file, but I don't the name of it; Is this code correct and is there a better way to do this thing?? int main() { cout << " type file name:" char *...
2
by: creative1 | last post by:
Is this possible to store data in an XML file using HTML form? I got it working other way. I can store data in an xml file and display it in html form. I need to do it other way. It is very urgent. ...
2
by: pavanip | last post by:
Hi, I am developing one asp.net application about Employee and project management.In this I want to use file system instead of database to store the data.Please help me how to use file system...
4
by: madhuriks | last post by:
hi, im new to xml..i developed one application using jsp file..if i enter the values it should store in xml file...for storing using servlet file...the problem is if i enter new values it is not...
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.