从excel导入sql server,可以将excel读入到dataset,然后到入sql.
从datagrid-〉dataset->excel.
下面有启发:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q306023

解决方案 »

  1.   

    问:从datagrid到入excel的源代码public void ToExcel(System.Web.UI.Control ctl)  
    {

    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);
    }
      

  2.   

    问题1
    http://www.csdn.net/develop/article/18/18623.shtm
    hope it helps
      

  3.   

    http://lucky_elove.www1.dotnetplayground.com/
      

  4.   

    参考:
    http://www.csdn.net/develop/read_article.asp?id=18623
    http://www.csdn.net/develop/read_article.asp?id=16987