csv数据导入到数据库的问题,紧急求助!
用ODBC和OLEDB都可以导入,但是有的文件是有两行标题,怎么跳过第一行标题把第二行标题当做列名string connStr = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + ";Extended Properties=text;";
OleDbConnection oleDbConnection = new OleDbConnection(connStr);
oleDbConnection.Open();
string strsql = "select * from TempFile.csv";
DataSet dataSet = new DataSet();
OleDbDataAdapter oleAdapter = new OleDbDataAdapter(strsql, connStr);
//将数据填充到dataset
oleAdapter.Fill(dataSet, _excelTableName);
oleDbConnection.Close();
各位大侠帮帮忙,谢了