I am working a C# Windows Application Form connecting to MS Access. I am filling the datagridview with a specific query but this happened
Syntax error (missing operator) in query expression 'Model WHERE Status = 'AVAILABLE''.
on this query
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);
What should I do?
Here's my code
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];
}