-
September 5th, 2011, 10:05 PM
#1
Linq to SQL C# - number range
I would how I can complete this task
In VB I have created an application with 2 textboxes.
The user entered a min value in one box and a max value in the other box. I need it to pull from the DB the rows that have a record called BattingAverage that are between the 2 values enters.
I tried this for when user clicks the sumbit button but i am way off from where i need to be. I am JUST learning c# but i figured this would be pretty easy.. guess i was wrong :P
private void btnAverage_Click(object sender, EventArgs e)
{
playerBindingSource.DataSource =
from PlayerID in database.Players
where PlayerID.BattingAverage.CompareTo(txtMin.Text)
orderby PlayerID.LastName
select PlayerID;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|