Click here to Skip to main content
15,904,823 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to retrieve 1 column [mobile_no] data from database and write into .txt file (i.e Notepad)

In my application when I click on Export Button
then it should open savedialog box to save the .txt file on a particular path

How to implement this idea ?
Posted
Updated 7-Aug-12 8:40am
v2
Comments
[no name] 7-Aug-12 14:51pm    
Plenty of ideas. The question is what have you tried yourself? What errors are you getting? Where is the code that demonstrates your problem?
Christian Amado 13-Aug-12 8:13am    
Find any solution helpful?

You can retrieve data from your database using DataTable.

After that you can access to the desired column just like this:
C#
DataTable dt = GetDataTableFromDB(); //This method returns a DataTable.

string values = dt.Rows["mobile_no"].ToString();


Saves the content of values in your txt file using StreamWriter.

Hope it helps.
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900