patrickstrijdonck
Programmer
Hello,
In my Treeview, the bindingsource for my Datagrid must be updated with a filter. Currently I have this piece of code that must do that
But an error occurs,
Filter expression '7622' does not evaluate to a Boolean term (*where 7622 is the storenumber which is picked up from the database)
Any idea what im doing wrong here?
In my Treeview, the bindingsource for my Datagrid must be updated with a filter. Currently I have this piece of code that must do that
Code:
// Get Storenumber from Storename
string command3;
string cmdemailasm3 = Properties.Settings.Default.IT4ConnectionString1;
command3 = @"SELECT Storenr FROM tblStores WHERE Storenaam = @name";
OleDbConnection connemailasm3 = new OleDbConnection(cmdemailasm3);
OleDbCommand comemailasm3 = new OleDbCommand(command3, connemailasm3);
comemailasm3.Parameters.AddWithValue("@name", SqlDbType.VarChar);
comemailasm3.Parameters["@name"].Value = e.Node.Text;
connemailasm3.Open();
outstandingCallsBindingSource1.Filter = Convert.ToString(comemailasm3.ExecuteScalar());
connemailasm3.Close();
But an error occurs,
Filter expression '7622' does not evaluate to a Boolean term (*where 7622 is the storenumber which is picked up from the database)
Any idea what im doing wrong here?