Sub sbLoadBackUpList()
Dim SQLcnn As New clsConnectivity()
Dim objCnn As SqlConnection = New SqlConnection(SQLcnn.cnn.ToString)
Dim objDataAdapter As New SqlDataAdapter()
Dim objGradings As DataSet = New DataSet()
Try
objDataAdapter.SelectCommand = New SqlCommand
objDataAdapter.SelectCommand.Connection = objCnn
objDataAdapter.SelectCommand.CommandText = "SELECT tblGradingEvents.GRADING_ID, tblVenues.VENUE_NM + ' on ' + CONVERT(VARCHAR(10),tblGradingEvents.GR_DATE , 103) AS [Grading Event] FROM tblGradingEvents LEFT OUTER JOIN tblVenues ON tblGradingEvents.VENUE_ID = tblVenues.VENUE_ID ORDER BY GR_DATE desc"
objDataAdapter.SelectCommand.CommandType = CommandType.Text
objDataAdapter.Fill(objGradings, "Gradings")
objDataAdapter = Nothing
With lstGradingsToMerge
.DataSource = objGradings.Tables("Gradings")
.DisplayMember = "Grading Event"
.ValueMember = "GRADING_ID"
End With
Catch ex As Exception
'-----------------
'Data load errors
Err.Clear()
MsgBox(Err.Description, MsgBoxStyle.Information, "System Error")
End Try
End Sub
|