我正在尝试在 asp.net c# 中使用 Microsoft.Jet.OLEDB.4.0 读取 csv 文件,但我收到错误消息“没有为一个或多个必需参数提供值”。
my select query :
string query = string.Concat("SELECT a_id, EpisodeId, Logged, [appintmentfollowporreferral] as Appointment, AppointmentType, AppointmentDateAndTime, AppointmentWith, Outcome, RTWStatus, Completed FROM " + appointmentReportsFileName);
here is the code that i am using to read the csv file :
string connString = string.Concat("Provider=Microsoft.Jet.OLEDB.4.0;", "Data Source=", filePath, ";", "Extended Properties=\"text;HDR=Yes;FMT=D=Delimited(,)\"");
//create an OleDbDataAdapter to execute the query
OleDbDataAdapter dAdapter = new OleDbDataAdapter(query, connString);
//fill the DataTable
dAdapter.Fill(dTable);
dAdapter.Dispose();
该文件包含查询字符串中指定的所有列名,我检查了列名是否有任何差异,但我找不到任何差异。
这是我正在尝试读取的 csv 文件:
请有人帮我解决这个问题....