1
我正在使用以下代碼導入CSV文件。導入CSV處理日期
try
{
OleDbConnection ExcelConnection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pathName + ";Extended Properties=Text;");
OleDbCommand ExcelCommand = new OleDbCommand(@"SELECT * FROM " + fileName, ExcelConnection);
OleDbDataAdapter ExcelAdapter = new OleDbDataAdapter(ExcelCommand);
ExcelConnection.Open();
DataSet ExcelDataSet = new DataSet();
ExcelAdapter.Fill(ExcelDataSet);
ExcelConnection.Close();
return ExcelDataSet;
}
catch
(Exception ex)
{
MessageBox.Show("Cannot read excel file");
return null;
}
這裏當列有一個值作爲
19.10.2011 10時08分56秒GMT
它變成爲
19.102
任何人都可以幫助我嗎?
問候,