1
Answer

Rowfilter with multiple textboxes

Mattias J

Mattias J

12y
2k
1
I would like to use two different textboxes to filter information from a database to display baseball players average score. Example selecting 0,3 to 0,4, should display players with scores between these number.

Whats not working is the following code:

// Textboxes with input data(decimal values)

decimal minimum = Convert.ToDecimal(textBox2.Text);
decimal minimum = Convert.ToDecimal(textBox2.Text);

// SQL query to perform the search from my database
view.RowFilter = "select * from Players where BattingAverage between '" + minimum + "and" + maximum + "'";

I get an error message reading: Syntax error: missing operand after 'Players' operator.

Please help me.

// Mofflon
Answers (1)