📄 moduledepartement.vb
字号:
Imports System.Data
Imports System.Data.sqlClient
Module ModuleDepartement
Public DepartementDataSet As DataSet = New DataSet
Dim CustDataAdapter As New SqlDataAdapter
Dim conn As New SqlConnection
'Dim StrData As String
Public DepartementTable As DataTable
Public DepartementRow As DataRow
Dim StrSql As String
Public ObjForm1 As New Form1
' Dim ObjResch As New resch
Public Sub Departement()
' StrData = "User ID=sa;Password=;Trusted_Connection=yes;Initial Catalog=assent;data source=localhost"
conn = New SqlConnection(StrData)
StrSql = "select * from T_DEPARTMENT"
Dim myCommand As SqlCommand = New SqlCommand(StrSql, conn)
conn.Open()
CustDataAdapter.SelectCommand = myCommand
CustDataAdapter.Fill(DepartementDataSet, "T_DEPARTMENT")
For Each DepartementRow In DepartementDataSet.Tables("T_DEPARTMENT").Rows
'ObjResch.ComboBox1.Items.Add(DepartementRow("DepName"))
Next
conn.Close()
DepartementTable = DepartementDataSet.Tables("T_DEPARTMENT")
DepartementTable = DepartementDataSet.Tables(0)
End Sub
End Module
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -