📄 form6.vb
字号:
Imports System.IO
Imports System.Data.SqlClient
Public Class frmTeacherQ
Inherits System.Windows.Forms.Form
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写 dispose 以清理组件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents label1 As System.Windows.Forms.Label
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
Friend WithEvents ListBox2 As System.Windows.Forms.ListBox
Friend WithEvents btnselect As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.label1 = New System.Windows.Forms.Label
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.btnselect = New System.Windows.Forms.Button
Me.Label2 = New System.Windows.Forms.Label
Me.ListBox1 = New System.Windows.Forms.ListBox
Me.ListBox2 = New System.Windows.Forms.ListBox
Me.SuspendLayout()
'
'label1
'
Me.label1.Location = New System.Drawing.Point(16, 16)
Me.label1.Name = "label1"
Me.label1.Size = New System.Drawing.Size(64, 24)
Me.label1.TabIndex = 0
Me.label1.Text = "查询条件"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(88, 16)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(120, 21)
Me.TextBox1.TabIndex = 1
Me.TextBox1.Text = "TextBox1"
'
'btnselect
'
Me.btnselect.Location = New System.Drawing.Point(248, 24)
Me.btnselect.Name = "btnselect"
Me.btnselect.Size = New System.Drawing.Size(88, 24)
Me.btnselect.TabIndex = 2
Me.btnselect.Text = "查询"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(16, 72)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(96, 32)
Me.Label2.TabIndex = 3
Me.Label2.Text = "教师基本信息"
'
'ListBox1
'
Me.ListBox1.ItemHeight = 12
Me.ListBox1.Location = New System.Drawing.Point(16, 128)
Me.ListBox1.Name = "ListBox1"
Me.ListBox1.Size = New System.Drawing.Size(232, 172)
Me.ListBox1.TabIndex = 4
'
'ListBox2
'
Me.ListBox2.ItemHeight = 12
Me.ListBox2.Location = New System.Drawing.Point(288, 144)
Me.ListBox2.Name = "ListBox2"
Me.ListBox2.Size = New System.Drawing.Size(136, 148)
Me.ListBox2.TabIndex = 5
'
'frmTeacherQ
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(440, 310)
Me.Controls.Add(Me.ListBox2)
Me.Controls.Add(Me.ListBox1)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.btnselect)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.label1)
Me.Name = "frmTeacherQ"
Me.Text = "Form6"
Me.ResumeLayout(False)
End Sub
#End Region
Dim sconnstring As String = "data source=(local);initial catalog=学校管理系统;integrated security=SSPI"
Dim mycn As New SqlConnection
Dim myTeachersSQL As String = "select * from 教师基本情况表"
Dim myTealsSQL As String = "select * from 教师电话号码表"
Dim mydataset As New DataSet
Dim myTeacherscommand As New SqlCommand(myTeachersSQL, mycn)
Dim myTelscommand As New SqlCommand(myTealsSQL, mycn)
Dim myteachersdataAdapter As New SqlDataAdapter
Dim mytelsdataAdapter As New SqlDataAdapter
Dim myteachersTable As New DataTable
Dim mytelsTable As New DataTable
Private Sub frmTeacherQ_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
mycn.ConnectionString = sconnstring
mycn.Open()
myteachersdataAdapter.SelectCommand = myTeacherscommand
mytelsdataAdapter.SelectCommand = myTelscommand
mydataset.Clear()
myteachersdataAdapter.Fill(mydataset, "教师基本情况表")
mytelsdataAdapter.Fill(mydataset, "教师电话号码表")
mycn.Close()
myteachersTable = mydataset.Tables("教师基本情况表")
mytelsTable = mydataset.Tables("教师电话号码表")
End Sub
Private Sub btnselect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnselect.Click
Dim i As Short
Dim s As Boolean
Dim str As String = ""
Dim datarowTeachers() As DataRow
Dim datarowTels() As DataRow
strid = txtcondition.text
for i=0 to myteacherstable.rows.count-1
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -