Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions