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