Hi everybody,
I have a simple sql database file that contains names and averages.
It is displayed in a dataGridView and I added a few textboxes to filter by name, minimum and maximum.
Filtering by name is easy since it is string to string.
the following code works as expected and filters by the name provided in the textbox.
private void buttonFilter_Click ( object sender, EventArgs e ) { playersTableAdapter.FillByFilter ( baseballDataSet.Players, textBoxLastname.Text); }
But for the average I have two problems:
1. I have to supply a value or I get:
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll.
Additional Information: Input string was not in the correct format.
2. If I supply values to the filter fields I get nothing back:
here is the code for that button:
private void button1_Click ( object sender, EventArgs e ) { playersTableAdapter.FillByBatting ( baseballDataSet.Players, Convert.ToDecimal(textBoxMinimum.Text), Convert.ToDecimal(textBoxMaximum.Text)); }
Any suggestions on what I'm missing?
Any help is greatly appreciated.