I am trying to get a listing of all records in a dataset to display in a table. I have tried several options I have found through research and get no where. Anyone have any easier ideas? Being new to programming in general, this have given me fits. Here's the last thing I tried:
strSQL = "Select * from Safety_Data where xref_id=" & strTypePull & "and Shift_ID=" & strShiftPull & "and Date='" & strSelDate & "'"
Dim objDataSet As New Data.DataSet
Dim objConn As New Data.SqlClient.SqlConnection("Data Source=XXXXXX;Initial Catalog=XXXXXX;User ID=XXXXXX;password=XXXXXX;")
Dim objCmd As New Data.SqlClient.SqlDataAdapter(strSQL, objConn)
objConn.Open()
objCmd.Fill(objDataSet)
Dim objDC As Data.DataColumn
Dim objDT As Data.DataRow
For Each objDT In objDataSet.Tables(0).Rows
For Each objDC In objDataSet.Tables(0).Columns
txtRecID = objDataSet.Tables(0).Rows(0)("RID").ToString()
txtDate = objDataSet.Tables(0).Rows(0)("Date").ToString()
txtShift = objDataSet.Tables(0).Rows(0)("Shift_ID").ToString( )
txtType = objDataSet.Tables(0).Rows(0)("Xref_ID").ToString()
TxtOccNotes = objDataSet.Tables(0).Rows(0)("Notes").ToString()
Next
Next