从excel导入sql server,可以将excel读入到dataset,然后到入sql.
从datagrid-〉dataset->excel.
下面有启发:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q306023
从datagrid-〉dataset->excel.
下面有启发:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q306023
解决方案 »
- C# 用BackgroundWorker生成word报错?
- silverlight effect问题
- 请教hook api的问题
- DevExpress的ASPxTreeList导出xls的问题
- 求用c#写的将页面导出为word的代码
- 这个论坛没有人能解决吗?“c#中添加连接时,数据源里面没有odbc可选的!!!! ”
- 高分.急啊.高手求教:怎么从我的网页怎么进入我在www.163.com 的通行证.不要手工操作.直接点击.就可以连接.
- 关于C#中的参数...
- C#使用Excel问题!急!先谢了!
- 在线:自己怎样引发事件?
- 关于重写DataGrid的DataGridTextBoxColumn类问题
- 窗体启动问题,初学者,
{
HttpContext.Current.Response.AppendHeader("Content-Disposition","attachment;filename=DayReport.xls");
HttpContext.Current.Response.Charset ="UTF-8";
HttpContext.Current.Response.ContentEncoding =System.Text.Encoding.Default;
HttpContext.Current.Response.ContentType ="application/ms-excel";//image/JPEG;text/HTML;image/GIF;vnd.ms-excel/msword
ctl.Page.EnableViewState =false;
System.IO.StringWriter tw = new System.IO.StringWriter() ;
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter (tw);
ctl.RenderControl(hw);
HttpContext.Current.Response.Write(tw.ToString());
HttpContext.Current.Response.End();
}
private void Btn_Excel_Click(object sender, System.EventArgs e)
{
ToExcel(DataGrid1);
}
http://www.csdn.net/develop/article/18/18623.shtm
hope it helps
http://www.csdn.net/develop/read_article.asp?id=18623
http://www.csdn.net/develop/read_article.asp?id=16987