English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

can i use sql server2005?
if yes which edition?

2007-03-16 17:32:01 · 2 answers · asked by Pearsdude 1 in Computers & Internet Programming & Design

2 answers

Use SSIS (SQL Server Integrated Services) to import the data from Excel into your SQL database.

2007-03-16 18:26:05 · answer #1 · answered by Rex M 6 · 0 0

hi, I provide you code that are stated under public void ExportToExcel(DataTable dt) { con.Open(); string sq. = "decide on *from try"; cmd = new SqlCommand(sq., con); dt = new DataTable(); da = new SqlDataAdapter(cmd); da.Fill(dt); GridView1.DataSource = dt; GridView1.DataBind(); cmd.Dispose(); string filename = "DownloadTest.xls"; equipment.IO.StringWriter tw = new equipment.IO.StringWriter(); equipment.cyber web.UI.HtmlTextWriter hw = new equipment.cyber web.UI.HtmlTextWriter(tw); DataGrid dgGrid = new DataGrid(); dgGrid.DataSource = dt; dgGrid.DataBind(); dgGrid.RenderControl(hw); reaction.ContentType = "application/vnd.ms-excel"; reaction.AppendHeader("content textile-Dispositi... "attachment; filename=" + filename + ""); this.EnableViewState = fake; reaction.Write(tw.ToString()); reaction.end(); con.close(); }

2016-10-18 21:38:45 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers