📄 form7.vb
字号:
Public Class Form7
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 Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents SqlDataAdapter1 As System.Data.SqlClient.SqlDataAdapter
Friend WithEvents DataSet11 As 学生考勤管理系统.DataSet1
Friend WithEvents SqlCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlInsertCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.Button3 = New System.Windows.Forms.Button
Me.SqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter
Me.DataSet11 = New 学生考勤管理系统.DataSet1
Me.SqlCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlInsertCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Button1
'
Me.Button1.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Button1.ForeColor = System.Drawing.Color.DarkSalmon
Me.Button1.Location = New System.Drawing.Point(104, 128)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(184, 48)
Me.Button1.TabIndex = 0
Me.Button1.Text = "学生考勤信息管理"
'
'Button2
'
Me.Button2.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Button2.ForeColor = System.Drawing.Color.DarkSalmon
Me.Button2.Location = New System.Drawing.Point(104, 56)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(184, 48)
Me.Button2.TabIndex = 1
Me.Button2.Text = "学生信息刷卡"
'
'Button3
'
Me.Button3.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Button3.ForeColor = System.Drawing.Color.Gold
Me.Button3.Location = New System.Drawing.Point(312, 232)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(64, 32)
Me.Button3.TabIndex = 2
Me.Button3.Text = "退出"
'
'SqlDataAdapter1
'
Me.SqlDataAdapter1.InsertCommand = Me.SqlInsertCommand1
Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
Me.SqlDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "刷卡信息表", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("IC卡号", "IC卡号"), New System.Data.Common.DataColumnMapping("班级", "班级"), New System.Data.Common.DataColumnMapping("姓名", "姓名"), New System.Data.Common.DataColumnMapping("学号", "学号"), New System.Data.Common.DataColumnMapping("上课时间", "上课时间"), New System.Data.Common.DataColumnMapping("下课时间", "下课时间"), New System.Data.Common.DataColumnMapping("日期", "日期")})})
'
'DataSet11
'
Me.DataSet11.DataSetName = "DataSet1"
Me.DataSet11.Locale = New System.Globalization.CultureInfo("zh-CN")
'
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "SELECT IC卡号, 班级, 姓名, 学号, 上课时间, 下课时间, 日期 FROM 刷卡信息表"
Me.SqlSelectCommand1.Connection = Me.SqlConnection1
'
'SqlInsertCommand1
'
Me.SqlInsertCommand1.CommandText = "INSERT INTO 刷卡信息表(IC卡号, 班级, 姓名, 学号, 上课时间, 下课时间, 日期) VALUES (@IC卡号, @班级, @姓名, @学号," & _
" @上课时间, @下课时间, @日期); SELECT IC卡号, 班级, 姓名, 学号, 上课时间, 下课时间, 日期 FROM 刷卡信息表"
Me.SqlInsertCommand1.Connection = Me.SqlConnection1
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@IC卡号", System.Data.SqlDbType.VarChar, 50, "IC卡号"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@班级", System.Data.SqlDbType.VarChar, 50, "班级"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@姓名", System.Data.SqlDbType.VarChar, 50, "姓名"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@学号", System.Data.SqlDbType.VarChar, 50, "学号"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@上课时间", System.Data.SqlDbType.VarChar, 50, "上课时间"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@下课时间", System.Data.SqlDbType.VarChar, 50, "下课时间"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@日期", System.Data.SqlDbType.VarChar, 50, "日期"))
'
'SqlConnection1
'
Me.SqlConnection1.ConnectionString = "workstation id=levono20;packet size=4096;user id=sa;data source=levono20;persist " & _
"security info=False;initial catalog=zjs"
'
'Form7
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.BackColor = System.Drawing.Color.DodgerBlue
Me.ClientSize = New System.Drawing.Size(408, 301)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.ForeColor = System.Drawing.Color.Blue
Me.Name = "Form7"
Me.Text = "Form7"
CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Form4 As New Form4
Form4.Show()
Me.Hide()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
SqlConnection1.Open()
SqlCommand1.Connection = SqlConnection1
SqlCommand1.CommandText = "delete from 刷卡信息表"
SqlCommand1.ExecuteNonQuery()
SqlConnection1.Close()
Dim Form2 As New Form2
Form2.Show()
Me.Hide()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim Form1 As New Form1
Form1.Show()
Me.Hide()
End Sub
Private Sub SqlDataAdapter1_RowUpdated(ByVal sender As System.Object, ByVal e As System.Data.SqlClient.SqlRowUpdatedEventArgs) Handles SqlDataAdapter1.RowUpdated
End Sub
Private Sub Form7_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -