I have a data adapter that pulls two different tables from an Access database:
1. RepData - contains statistical info on cust serv reps
2. Agents - contains names linked by Logid field
If I right click on the Data Adapter and choose 'Preview Data' I can see the appropriate data with the exception of the date ranges (entered by user).
But I cannot get the datagrid to show that info. I have it selecting the right data, if I just pull from the 'RepData' table (thus showing data with LogId).
Once I try to link the 'Agents' table to show names, I get nothing.
Then of course that is appended when the user makes their Team/Date range choices:
Can anyone point me in the right direction? Any help appreciated!
1. RepData - contains statistical info on cust serv reps
2. Agents - contains names linked by Logid field
If I right click on the Data Adapter and choose 'Preview Data' I can see the appropriate data with the exception of the date ranges (entered by user).
But I cannot get the datagrid to show that info. I have it selecting the right data, if I just pull from the 'RepData' table (thus showing data with LogId).
Once I try to link the 'Agents' table to show names, I get nothing.
Code:
Me.OleDbSelectCommand2.CommandText = "SELECT tblAgents.FirstName, tblAgents.LastName, tblRepData.Logid, tblRepData.Calls, tblRepData.Staffhours, tblRepData.Row_Date, tblRepData.Team, tblAgents.EmpId FROM (tblAgents INNER JOIN tblRepData ON tblAgents.LogId = tblRepData.Logid)"
Me.OleDbSelectCommand2.Connection = Me.cnRrpData
Code:
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
daAgents.SelectCommand.CommandText = daAgents.SelectCommand.CommandText & " Where (tblRepData.Team = '" & lstTeams.SelectedValue.ToString & "') and (Row_Date BETWEEN #" & StartDate.Text & "# and #" & EndDate.Text & "#)"
daAgents.Fill(DsAgents)
dgTeamInfo.DataBind()
End Sub