注明:必须按照数据库字段的“顺序”,“字段格式 ”来写EXCEL;自动编号不要写入EXCEL。 我这里用的是ACCESS 前台代码: <% ... @ Page language="c#" Codebehind="Excel.aspx.cs" AutoEventWireup="false" Inherits="TestAll.Excel" %> <! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > < HTML > < HEAD > < title > Excel </ title > < meta content ="Microsoft Visual Studio .NET 7.1" name ="GENERATOR" > < meta content ="C#" name ="CODE_LANGUAGE" > < meta content ="JavaScript" name ="vs_defaultClientScript" > < meta content ="http://schemas.microsoft.com/intellisense/ie5" name ="vs_targetSchema" > </ HEAD > < body MS_POSITIONING ="GridLayout" > < form id ="Form1" method ="post" runat ="server" > < TABLE id ="Table1" style ="Z-INDEX: 101; LEFT: 0px; POSITION: absolute; TOP: 0px" height ="100%" cellSpacing ="1" cellPadding ="1" width ="100%" border ="0" > < TR > < TD style ="FONT-SIZE: 12px; COLOR: appworkspace" align ="center" colSpan ="3" >< FONT face ="宋体" > </ FONT > < TABLE id ="Table3" style ="FONT-SIZE: 12px" cellSpacing ="1" cellPadding ="1" width ="300" border ="0" > < TR > < TD style ="FONT-WEIGHT: bolder; FONT-SIZE: 12pt" align ="center" colSpan ="2" > EXCEL批量上传 </ TD > </ TR >