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
VulpesPosted Jan 16, 2013, 2:01 PM
http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression.aspx
So, I'd try here:
view.RowFilter = String.Format("BattingAverage >= {0} AND BattingAverage <= {1}", minimum, maximum);