Error: Syntax error (missing operator) in query expression '(Job Number [email protected]')'.
I have tried without the @ and used '", but nothing.
private void btnExit_Click(object sender, EventArgs e)
{
DialogResult dialog = MessageBox.Show("Do you really want to close the ECM program?", "Exit ECM", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dialog == DialogResult.Yes)
{
Application.Exit();
}
}
private void btnSearchDB_Click(object sender, EventArgs e)
{
OleDbConnection accessConnect = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\ECM\ECM\ECM\ECM.mdb");
DataTable dt = new DataTable();
if (txtJobNumber.Text.Length > 0)
{
OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROM ECMeasurements WHERE (Job Number [email protected]" + txtJobNumber.Text.ToString() + "')", accessConnect);
da.Fill(dt);
dataGridView1.DataSource = dt;
}
if (txtDate.Text.Length > 0)
{
OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROM ECMeasurements WHERE (Date [email protected]" + txtDate.Text.ToString() + "')", accessConnect);
da.Fill(dt);
dataGridView1.DataSource = dt;
}
if (cbAlloyTemperDB.Text.Length > 0)
{
OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROM ECMeasurements WHERE (Alloy/Temper = @" + cbAlloyTemperDB.Text.ToString() + "')", accessConnect);
da.Fill(dt);
dataGridView1.DataSource = dt;
}
}
}

New Topic/Question
Reply


MultiQuote




|