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 System.IO;
using System.Data.Odbc;
namespace exportcsv
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string csvfile = @"c:\temp.csv";
string strCon = "Driver={SQL Server};Server=10.10.82.211;Database=ceshi;Uid=sa;Pwd=***";
OdbcConnection MyCon = new OdbcConnection(strCon);
string strSQL = "select GUID as GUID,title as 标题,contents as 内容, datetime as 时间 from gridview";
GetData(csvfile,MyCon,strSQL);
}
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载