如何下載在窗體窗體上顯示的數據,這些數據以列和行的形式從數據庫中檢索?我想以Word格式下載數據。任何人都可以幫忙嗎?這是我用來檢索數據的代碼數據檢索和下載
private void button6_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=MYPC\\MSSQLSERVERNAVEN;Initial Catalog=Test;Integrated Security=True;";
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "select * from login_details1";
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
BindingSource bg = new BindingSource();
bg.DataSource = dr;
dataGridView1.DataSource = bg;
con.Close();
}
那麼什麼是以doc格式下載數據的代碼?
它不清楚你想要做什麼,以及你已經嘗試過什麼 – 2014-09-25 11:29:39