我有一个数据集包含 1 个表,我想在该表上迭代循环。
在循环内部,我想检查第 1 列是否为日期类型,转义该列并移至下一列。请帮助我。
excelConnection = new OleDbConnection(connectionString);
//Get the name of First Sheet
excelConnection.Open();
excelSheet = excelConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
string sheetName = excelSheet.Rows[0]["TABLE_NAME"].ToString();
excelConnection.Close();
string query = "SELECT * FROM [" + sheetName + "]";
excelCommand = new OleDbCommand(query, excelConnection);
excelDataAdapter = new OleDbDataAdapter(excelCommand);
excelDataAdapter.Fill(excelData);
提前致谢。