Private Sub PopulateBatchLoadDataGridView()
Dim tl As New SortableBindingList(Of TechnologySet)(TechnologySetDB.GetTechnologyData)
If tl.Count > 0 Then
dgvTechnologySets.DataSource = tl
Else
dgvTechnologySets.DataSource = Nothing
End If
End Sub
Public Shared Function GetTechnologyData() As List(Of TechnologySet)
Dim techlist As New List(Of TechnologySet)
Dim CnSql As SqlConnection = BadsDB.GetConnection
Dim cmdA As SqlCommand
cmdA = New SqlClient.SqlCommand("up_CompareTechnology", CnSql)
cmdA.CommandType = CommandType.StoredProcedure
Try
CnSql.Open()
Dim reader As SqlDataReader = cmdA.ExecuteReader(CommandBehavior.CloseConnection)
Dim t As New TechnologySet
Dim x As Integer = 1
Do While reader.Read
t.TechnologySetCode = reader("TechnologySetCode").ToString
t.TechnologySetName = reader("TechnologySetName").ToString
t.TechnologySetType = reader("TechnologySetType").ToString
t.Notes = reader("Notes").ToString
techlist.Add(t)
Loop
Return techlist
Catch excA As SqlException
MsgBox(excA.Message)
Return Nothing
Finally
CnSql.Close()
End Try
|