private DataSet GetExcel(string Path) 



OleDbConnection objConn=null; 
DataSet data=new DataSet(); 
try 

string strConn= "Provider=Microsoft.Jet.OleDb.4.0;" + "data source="+Path+ ";Extended Properties=Excel 5.0;"; 
objConn=new OleDbConnection(strConn); 
objConn.Open(); 
DataTable schemaTable = objConn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables,null); 
string tableName=schemaTable.Rows[0][2].ToString().Trim(); 
string strSql= "Select * From ["+tableName+"]"; 
OleDbCommand objCmd=new OleDbCommand(strSql, objConn); 
OleDbDataAdapter sqlada=new OleDbDataAdapter(); 
sqlada.SelectCommand=objCmd; 
sqlada.Fill(data,"BuyPrice"); 
objConn.Close(); 

catch 
{  
objConn.Close(); 
throw; 

return data; 
} 先将EXCEL 文件(拷贝到服务器的)中的数据转换成DATASET 
再每条转换数据格式再插数据库这里估计有1000多条和很少
见下面的存储过程:
CREATE PROCEDURE DataIn_Products_Update 
 AS
SET XACT_ABORT  ON 
begin transaction 
update CMRC_Products 
set Categoryid=b.realid
from 
(
select c.Categoryid realid,t.categoryid faleid from 
CMRC_Categories_Temp t,CMRC_Categories c
 where t.CategoryName=c.CategoryName
)b
where categoryid=b.faleid
insert into CMRC_Products_New select 
Convert(int,CategoryID),ModelNumber,ModelName,Spec,Unit,UnitCost,PackUnit,Description,CostPrice,FactoryPrice,SuggestPrice,ExecuteDateStart,ExecuteDateEnd,BlankOutTag,BarCode,Re,Stocks,UpperLimitStocks,LowerLimitStocks,AttributeID,LockIn,MaySendOut
from CMRC_Products
delete from CMRC_Productslist
insert into CMRC_Productslist
select c.CustomerId,p1.ProductId,p1.unitcost,p1.unitcost,p1.unitcost,
getdate(),dateadd(year,1,getdate()),
'1',
p1.re,
'0.17','1.0',unitcost*0.83
 from  CMRC_Customers c cross join 
(select p.ProductId,p.unitcost,
p.re from CMRC_Products p where p.BlankOutTag='1' ) p1
if @@error=0
commit tran
else
rollback tran
GO
这个存储过程处理的书记就上几十万条了
我很担心服务器被脱跨