Dim DBConn As SqlConnection
DBConn = New SqlConnection(dbstring)
DBConn.Open()
Dim mySqlCommAND As SqlCommand
Dim QueryString As String
QueryString = "select top 20 유형1, 유형2, 파일명, 예비1 from TB_U_UnitECT order by 예비1 desc"
mySqlCommAND = New SqlCommand(QueryString, DBConn)
Dim DBread As SqlDataReader = mySqlCommAND.ExecuteReader()
ListBox6.Items.Clear()
While (DBread.Read())
ListBox6.Items.Add("●" & DBread.Item("유형2") & Space(100) & _
DBread.Item("유형1") & Space(100) & _
DBread.Item("파일명") & Space(100) & _
DBread.Item("예비1"))
End While
DBread.Close()
mySqlCommAND.Dispose()
DBConn.Close()