TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Naidu AMMAN
NA
37
35.3k
how to save the database in textfile by using c# windows
Sep 25 2013 3:53 AM
hi this gyana. please how to call from data base in C# by using select query and how to save this data in text file please reply me.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DataAccessLayer;
namespace prjtims
{
public partial class frmtotremits : Form
{
public frmtotremits()
{
InitializeComponent();
}
private void btnok_Click(object sender, EventArgs e)
{
IDBManager dbManager = new DBManager(DataProvider.MySql);
dbManager.ConnectionString = "Server=local instance MYSQL56;Database=microfx
Uid=root;Pwd=root";
try
{
dbManager.Open();
dbManager.ExecuteReader(CommandType.Text, "SELECT count(*),etd_ticket_type,sum(etd_child_fare),sum(etd_adult_fare),etd_service_code FROM microfx.etm_ticket_data_private_aug_2013 where ETD_LAST_UPD_DATE between '2013-07-30 18:30:00' and '2013-07-31 18:30:00' group by etd_ticket_type,etd_service_code order by etd_service_code;");
cmb_srvc_no.Text = "";
date_tm_pckr_frm_dte.Text = "";
dt_tm_pkr_to_date.Text = "";
string file_name = "E:\\oracle.txt";
System.IO.StringReader objReader;
objReader = new System.IO.StringReader(file_name);
//objReader.ReadLine(file_name);
objReader.Close();
dbManager.Close();
}
catch (Exception ex)
{
//Usual Code
}
finally
{
dbManager.Dispose();
MessageBox.Show("Sucessfully opened");
}
}
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
Reply
Answers (
2
)
3 4 5 makes a right-angled triangle 3 5 4 makes a right-angl
HOW TO DELETE DUPLICATE VALUES IN SQL