Link to home
Start Free TrialLog in
Avatar of comsult
comsult

asked on

VB.net SQL Statement Problems

Using SQLCE in Visual Studio.net (VB) 2005, we have the following SQL statement which works as intended.

"SELECT ItemID, Title, DomesticShippingService1, DomesticShippingCost1, ShippingAdditionalCost1 FROM EUKSLData"

We use that statement again (with a WHERE) later in our code to give more specific results in a datagrid.

"SELECT ItemID, Title, DomesticShippingService1, DomesticShippingCost1, ShippingAdditionalCost1 FROM EUKSLData WHERE (LType = 'Daily') AND (BPrice > '0') OR (LType = 'Weekly') OR (LType = 'Monthly')"

Again, this works as intended as does the folloiwng statement which is used to allow the user to refine their selection via a text box.

"SELECT ItemID, Title, DomesticShippingService1, DomesticShippingCost1, ShippingAdditionalCost1 FROM EUKSLData WHERE Title LIKE '%" & TextBox1.Text & "%'"

We would like to combine the second and third statements so that the LType and BPrice are also checked but can't seem to get it working. We need to keep the textbox to allow the users some input.

Any help would be appreciated. Thank you.
       









       

ASKER CERTIFIED SOLUTION
Avatar of UnifiedIS
UnifiedIS

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of comsult
comsult

ASKER

Perfect, thank you so much for the quick response.