Advertisement
Advertisement
| 04.28.2008 at 05:42AM PDT, ID: 23358461 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: |
Private Sub frmBIA_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ConnectionStr As String
ConnectionStr = GetDBString()
connection1 = New OleDb.OleDbConnection(ConnectionStr)
dsDept = New DataSet("Departments")
dsDept.Clear()
cmd = New OleDb.OleDbCommand("SELECT * FROM Departments ORDER BY dept")
daDept = New OleDb.OleDbDataAdapter
daDept.SelectCommand = cmd
Try
connection1.Open()
daDept.Fill(dsDept, "dept")
connection1.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
For Each row As DataRow In dsDept.Tables("dept").Rows
lstDept.Items.Add(row.Item("Dept"))
Next
End Sub
|