Private void inputexcel (string ppath)
{
String conn = "provider = Microsoft. Jet. oledb.4.0; Data Source =" + ppath + "; extended properties = 'excel 8.0; HDR = false; IMEX = 1 '";
Oledbconnection olecon = new oledbconnection (conn );
Olecon. open ();
String SQL = "select * from [sheet1 $]";
Oledbdataadapter mycommand = new oledbdataadapter (SQL, olecon );
Dataset DS = new dataset ();
Mycommand. Fill (DS, "[sheet1 $]");
Olecon. Close ();
Int COUNT = Ds. Tables ["[sheet1 $]"]. Rows. count;
For (INT I = 0; I <count; I ++)
{
String tuserid, tusername, tdept, temail, tleader, tangent;
Tuserid = Ds. Tables ["[sheet1 $]"]. Rows [I] ["Employee replacement"]. tostring (). Trim ();
Tusername = Ds. Tables ["[sheet1 $]"]. Rows [I] ["employee name"]. tostring (). Trim ();
Tdept = Ds. Tables ["[sheet1 $]"]. Rows [I] ["represent the region of the region"]. tostring (). Trim ();
Temail = Ds. Tables ["[sheet1 $]"]. Rows [I] ["E-mail address"]. tostring (). Trim ();
Tleader = Ds. Tables ["[sheet1 $]"]. Rows [I] ["direct supervisor"]. tostring (). Trim ();
Tangent = Ds. Tables ["[sheet1 $]"]. Rows [I] ["agent"]. tostring (). Trim ();
String excelsql = "insert into" + this. userinfo. company + ".. [resak] (resak001, resak002, resak015, resak005, resak013, resak009) values ('"+ tuserid +"', '"+ tusername + "', '"+ tdept +"', '"+ temail +"', '"+ tleader +"', '"+ tangent + "')";
Dbcommand cmd = dscdbdata. getdatadbcommand ();
Cmd. exenonquery (excelsql );
}
}