Question: VISUAL BASIC VISUAL BASIC VISUAL BASIC So far I have created an application where a query executes against a Players table of a Baseball database.

VISUAL BASIC VISUAL BASIC VISUAL BASIC So far I have created an application where a query executes against a Players table of a Baseball database. The table is displayed in DataGridView. Add a TextBox and Button allows the user to search for a specific player by last name. Here is the code I have for the last name button:

Dim lastNameQuery = From player In dbcontext.Players Where player.LastName.StartsWith(txtLastName.Text) Order By player.LastName, player.FirstName Select player

'display results PlayerBindingSource.DataSource = lastNameQuery.ToList() PlayerBindingSource.MoveFirst() 'go to first result

Now I need help:

I need to allow the user to locate players with batting averages in a specific range. I added a minimumTextBox for the minimum batting average (0.000 by default) and a maximumTextBox for the maximum batting average (1.000 by default). I added a Button for executing a query that selects rows from the Players table in which the BattingAverage column is greater than or equal to the specified minimum value and less than or equal to the specified maximum value.

I cannot figure out the code to display the results based on the range the user puts in. Can anyone create the code for the batting average button, which brings up results from the table within range of the min and max bating average that the user enters?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!