在C#中,我想在Access上运行以下查询
query = @"SELECT Jobs.Client, Jobs.Name, Jobs.Area,
Jobs.DevHours, Sum([Activities.Duration]) AS SumOfDuration
FROM Jobs INNER JOIN Activities ON Jobs.ID = Activities.JobId
GROUP BY Jobs.Client, Jobs.Name, Jobs.Area, Jobs.DevHours;";`
在进行查询后,我使用dataadapter读取数据并将数据填充到数据表中:
OleDbCommand command = new OleDbCommand
{
CommandText = query,
Connection = connection
};
OleDbDataAdapter da = new OleDbDataAdapter(command);
DataTable table = new DataTable();
da.Fill(table);
但是在运行时我遇到了一个错误,就是说
聚合参数中不能有备注,OLE或超链接对象字段([Activities.Duration])
如果有人可以帮助我,我真的很感激。