Mattias J

Mattias J

  • NA
  • 1
  • 0

Rowfilter with multiple textboxes

Jan 16 2013 2:59 AM
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)