这个是EXCEL的数据
序号 销售 余额 时间1 0 12 2007-8-16 14:45
2 0 80 2007-8-17 8:14
3 1 13 2007-9-12 14:34
4 1 91 2007-9-12 8:34
5 1 73 2007-8-13 16:54
6 1 45 2007-8-13 16:54
7 1 66 2007-8-13 16:46
8 1 77 2007-8-13 16:54
怎么把上面的数据导入到oracle数据库里father表,其中father表有(F_ID F_SALES F_LEADER F_TIME)四个字段
序号 销售 余额 时间1 0 12 2007-8-16 14:45
2 0 80 2007-8-17 8:14
3 1 13 2007-9-12 14:34
4 1 91 2007-9-12 8:34
5 1 73 2007-8-13 16:54
6 1 45 2007-8-13 16:54
7 1 66 2007-8-13 16:46
8 1 77 2007-8-13 16:54
怎么把上面的数据导入到oracle数据库里father表,其中father表有(F_ID F_SALES F_LEADER F_TIME)四个字段
还有个简单的:
建一个空表temp,列名和类型与excel一致,然后选中excel所有数据,不包括标题行,ctrl+c,
然后在pl/sql developer 里select * from temp for update,然后点下那个锁的图标,
然后选中所有列,然后ctrl+v,commit,就ok了
private DataTable ReadExcelData(string strFileName)
{
string strSQLCommand = "SELECT * FROM [Sheet1$] ";
string strConn;
System.Data.OleDb.OleDbConnection conn;
System.Data.OleDb.OleDbDataAdapter myCommand;
DataTable dt = new DataTable(); strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + strFileName + ";Extended Properties=Excel 8.0;";
conn = new System.Data.OleDb.OleDbConnection(strConn);
myCommand = new System.Data.OleDb.OleDbDataAdapter(strSQLCommand, strConn);
myCommand.Fill(dt);
return dt;
}
把它读到datatable中 然后返回到数据库