Hi guys. I have an ASP.Net assignment to do and need some assistance if possible.
I previously read a post from a person with the same assignment but this is for ASP.Net LINQ to SQL not windows form. The following is my code forthe batting average.
Code-Behind
private void btnBattingAverage_Click(object sender, EventArgs e)
{
var Players =
from player in database.Players
where player.BattingAverage >= decimal.Parse(txtMin.Text) && player.BattingAverage <= decimal.Parse(txtMax.Text)
select player;
List<Player> FindBy = Players.ToList();
playerDataGridView.DataSource = FindBy;
}
For some reason is not working. The code seems fine to me. Is there another way of doing this problem?
Thanks I appreciate for your assistance.