我正在使用连接到 MS Access 的 C# Windows 应用程序表单。我正在用特定查询填充 datagridview 但这发生了
查询表达式 'Model WHERE Status = 'AVAILABLE'' 中的语法错误(缺少运算符)。
关于这个查询
OleDbDataAdapter daAvailable = new OleDbDataAdapter("SELECT Type, Brand, Model, SerialNo, Status, Remarks, RAM, HDD, ODD, VideoCard, PS FROM Available ORDER BY Type, Brand, Model WHERE Status = 'AVAILABLE'", cnn);
我该怎么办?
这是我的代码
OleDbConnection cnn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\james\Documents\Visual Studio 2010\Projects\Vault\Vault\VaultDatabase.accdb");
DataSet dstAvailable = new DataSet();
DataSet dstData = new DataSet();
DataSet dstDeployment = new DataSet();
DataSet dstLog = new DataSet();
public void FillAvailable(DataGridView dgv)
{
OleDbDataAdapter daAvailable = new OleDbDataAdapter("SELECT Type, Brand, Model, SerialNo, Status, Remarks, RAM, HDD, ODD, VideoCard, PS FROM Available ORDER BY Type, Brand, Model WHERE Status = 'AVAILABLE'", cnn);
daAvailable.Fill(dstAvailable);
dgv.DataSource = dstAvailable.Tables[0];
}