Please forgive me if this looks a little strange. I am a fairly new beginner to C#.
I have a linq to sql query that populates various fields on the form. Another section of the form, needs to pull information from another table based off the value of the textbox, "employeeNumberTextBox". Then display that data in a DataGridView
.
I have tried to use the following code; however, I think what might be messing me up is the fact that a) there is a date field on the table, and b) there are multiple rows for employeeNumber in this table. Would be an accurate assumption?
int searchValue = Convert.ToInt32(employeeNumberTextBox.Text.Trim());
var qry = (from p in Globals.db.Employees_Histories
where p.employeeNumber.Equals(searchValue)
select p).ToList();
employees_HistoryDataGridView.DataSource = qry;
I keep receiving an error saying there is a type mismatch; however, I have tried to figure out exactly what that means and it has me a little confused atm.
Any assistance would be greatly appreciated.