I have a dataset that is defined in my project already.
I would like to populate my datagridview with this dataset, after being filtered through this query:
Questions contained within the above code.
Basically, are these steps correct?
Thanks!
I would like to populate my datagridview with this dataset, after being filtered through this query:
C#:
private void updatedgv(DataGridView dgv)
{
// this.timeDataTableAdapter1.Fill(this.timeDataSet.TimeData);
DataTable dt_TimeData = timeDataSet.Tables["TimeData"];
var qryTimeDataSource = from a in dt_TimeData.AsEnumerable()
orderby a.Field<String>("EmployeeNo")
where (a.Field<String>("EmployeeNo") == txtEmployeeNumber.Text)
&& (a.Field<DateTime>("Date") == dateTimePicker1.Value)
select a;
// How do I convert the above query to what I need to fill the table adapter with?
this.timeDataTableAdapter1.Fill("I believe a new table from the above query goes here...");
// This is wrong...
dgv.DataSource = qryTimeDataSource;
Questions contained within the above code.
Basically, are these steps correct?
- DataTable
- Query
- Fill Table Adapter with Table (derived from query)
Thanks!