I can get the name of the table in the dataset but not the contents
This is the code I have right now
Code:
Public Function GetLevel5Manager(ByRef strCriteria As String) As DataTable
Try
Dim strConn As String = HttpContext.Current.Session("ConnStr")
Dim conn As New SqlConnection(strConn)
Dim da As New SqlDataAdapter
Dim ds As DataSet = New DataSet("Users")
Dim cmd As SqlCommand
Dim strCrit As String = Mid(strCriteria, 11, 7)
conn.Open()
cmd = conn.CreateCommand()
With cmd
.CommandText = "SELECT U.FullName FROM DropDownData D, Users U WHERE D.DropDownCategory = 'Level5' AND D.DisplayValue ='" & strCrit & "'and D.Misc1 = U.Associate_ID"
.CommandType = CommandType.Text
End With
da = New SqlDataAdapter(cmd)
da.Fill(ds, "Users")
lblLevel5Manager.Text = Convert.ToString(ds.Tables.Item("Users"))
conn.Close()
Catch ex As Exception
Dim sTemp As String
sTemp = ex.Message
lblLevel5Manager.Text = ex.Message
End Try
End Function