HI all,
Why does the following code include both an AND and an OR in the SQL?
Customers objCustomers = new Customers();
objCustomers.Query.OpenParenthesis();
objCustomers.Where.CustomerReferenceNo.Value = "%" + txtCustomerSearch + "%";
objCustomers.Where.CustomerReferenceNo.Operator = WhereParameter.Operand.Like;
objCustomers.Query.CloseParenthesis();
objCustomers.Query.AddConjunction(WhereParameter.Conj.Or);
objCustomers.Where.Title.Value = "%" + txtCustomerSearch.Text + "%";
objCustomers.Where.Title.Operator = WhereParameter.Operand.Like;
objCustomers.Query.AddConjunction(WhereParameter.Conj.Or);
etc etc
Resulting SQL:
SELECT * FROM [dbo].[Customers] WHERE ([CustomerReferenceNo] LIKE @CustomerReferenceNo ) OR AND [Title] LIKE @Title OR AND .......so on and so forth.
Thank you
David
