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.Data.OleDb;
namespace login
{
public partial class 导出数据表结构 : Form
{
public 导出数据表结构()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string command="";
if (comboBox1.Text == "企业基本信息库")
{
command = String.Format("select * from 企业基本信息库");
}
else if (comboBox1.Text == "监察员信息")
{
command = String.Format("select * from 监察员信息");
}
else if (comboBox1.Text == "企业现场基本情况库")
{
command = String.Format("select * from 企业现场基本情况库");
}
else if (comboBox1.Text == "每年每组现场监察信息")
{
command = String.Format("select * from 每年每组现场监察信息");
}
string str = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=qyjc.mdb";
OleDbConnection con = new OleDbConnection(str);
con.Open();
OleDbDataAdapter da = new OleDbDataAdapter(command, con);
DataSet ds = new DataSet();
da.Fill(ds);
this.dataGridView1.DataSource = ds.Tables[0].DefaultView;
con.Close();
con.Dispose();
da.Dispose();
ds.Dispose();
}
}
}