Jump to content

Recommended Posts

Posted

I have an application which allows the user to select multiple combo boxes and then display data in a datagrid view depending on what is selected in the combo boxes.

 

However, one of my fields is called 'Fee'. Obviously, this is a decimal value, I am trying to use a combo box to select a range of fees (0 - 150, 151 - 200 etc).

 

For the other 3 combo boxes on the form, the values are coming from a stored procedure, however, i cannot do this for the 'fee' field because i receive errors when it tries to convert to decimal.

 

The text in my combo box will be like the example above (0 - 150) but the values in the database are formatted differently (150.00, 170.20).

 

My question is, how would i be able to filter out results in my datagrid view by using a range on the 'fee' field, i thought about a case statement but at the moment it just brings back a datagrid with 'rowerrors' as a column title.

Posted

How are you filling the datagrid?

 

If it uses a query then that should use the BETWEEN command using the lower and upper values from the combo box. Your case statement would be able to create the sql statement.

 

Does that make sense...?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • 47 When would you like EduGeek EDIT 2025 to be held?

    1. 1. Select a time period you can attend


      • I can make it in June\July
      • I can make it in August\Sept
      • Other time period. Comment below
      • Either time

×
×
  • Create New...