📄 form6.vb
字号:
'引用名称空间
Imports System.Data
Imports System.Data.OleDb
Public Class Form6
Inherits System.Windows.Forms.Form
'n是添加或者修改的状态参数
Dim n As Integer = 0
'ncommand是SQL命令
Dim ncommand As New OleDbCommand()
'nsql是SQL语句,bak1-8是用来备份的字符串
Dim nsql, bak1, bak2, bak3, bak4, bak5, bak6, bak7, bak8 As String
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写处置以清理组件列表。
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 DataGrid1 As System.Windows.Forms.DataGrid
Friend WithEvents OleDbSelectCommand1 As System.Data.OleDb.OleDbCommand
Friend WithEvents OleDbInsertCommand1 As System.Data.OleDb.OleDbCommand
Friend WithEvents Button5 As System.Windows.Forms.Button
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
Friend WithEvents Button6 As System.Windows.Forms.Button
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents TextBox5 As System.Windows.Forms.TextBox
Friend WithEvents outgoingtable As System.Data.OleDb.OleDbDataAdapter
Friend WithEvents OleDbConnection1 As System.Data.OleDb.OleDbConnection
Friend WithEvents MonthCalendar1 As System.Windows.Forms.MonthCalendar
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents TextBox6 As System.Windows.Forms.TextBox
Friend WithEvents Label8 As System.Windows.Forms.Label
Friend WithEvents TextBox7 As System.Windows.Forms.TextBox
Friend WithEvents Outgoingtable1 As WindowsApplication13.outgoingtable
Friend WithEvents OleDbDataAdapter1 As System.Data.OleDb.OleDbDataAdapter
Friend WithEvents OleDbSelectCommand2 As System.Data.OleDb.OleDbCommand
Friend WithEvents OleDbInsertCommand2 As System.Data.OleDb.OleDbCommand
Friend WithEvents DataSet11 As WindowsApplication13.DataSet11
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.DataGrid1 = New System.Windows.Forms.DataGrid()
Me.Outgoingtable1 = New WindowsApplication13.outgoingtable()
Me.outgoingtable = New System.Data.OleDb.OleDbDataAdapter()
Me.OleDbInsertCommand1 = New System.Data.OleDb.OleDbCommand()
Me.OleDbConnection1 = New System.Data.OleDb.OleDbConnection()
Me.OleDbSelectCommand1 = New System.Data.OleDb.OleDbCommand()
Me.Button5 = New System.Windows.Forms.Button()
Me.Button4 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button()
Me.ComboBox1 = New System.Windows.Forms.ComboBox()
Me.DataSet11 = New WindowsApplication13.DataSet11()
Me.Button6 = New System.Windows.Forms.Button()
Me.TextBox2 = New System.Windows.Forms.TextBox()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.Label4 = New System.Windows.Forms.Label()
Me.TextBox3 = New System.Windows.Forms.TextBox()
Me.Label5 = New System.Windows.Forms.Label()
Me.TextBox4 = New System.Windows.Forms.TextBox()
Me.Label6 = New System.Windows.Forms.Label()
Me.TextBox5 = New System.Windows.Forms.TextBox()
Me.MonthCalendar1 = New System.Windows.Forms.MonthCalendar()
Me.Label7 = New System.Windows.Forms.Label()
Me.TextBox6 = New System.Windows.Forms.TextBox()
Me.Label8 = New System.Windows.Forms.Label()
Me.TextBox7 = New System.Windows.Forms.TextBox()
Me.OleDbDataAdapter1 = New System.Data.OleDb.OleDbDataAdapter()
Me.OleDbInsertCommand2 = New System.Data.OleDb.OleDbCommand()
Me.OleDbSelectCommand2 = New System.Data.OleDb.OleDbCommand()
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.Outgoingtable1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'DataGrid1
'
Me.DataGrid1.DataMember = ""
Me.DataGrid1.DataSource = Me.Outgoingtable1.OutgoingTable
Me.DataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.DataGrid1.Name = "DataGrid1"
Me.DataGrid1.ReadOnly = True
Me.DataGrid1.Size = New System.Drawing.Size(640, 288)
Me.DataGrid1.TabIndex = 0
'
'Outgoingtable1
'
Me.Outgoingtable1.DataSetName = "outgoingtable"
Me.Outgoingtable1.Locale = New System.Globalization.CultureInfo("zh-CN")
Me.Outgoingtable1.Namespace = "http://www.tempuri.org/outgoingtable.xsd"
'
'outgoingtable
'
Me.outgoingtable.InsertCommand = Me.OleDbInsertCommand1
Me.outgoingtable.SelectCommand = Me.OleDbSelectCommand1
Me.outgoingtable.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "OutgoingTable", 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("单位", "单位"), New System.Data.Common.DataColumnMapping("金额", "金额"), New System.Data.Common.DataColumnMapping("单价", "单价"), New System.Data.Common.DataColumnMapping("备注", "备注")})})
'
'OleDbInsertCommand1
'
Me.OleDbInsertCommand1.CommandText = "INSERT INTO OutgoingTable(备注, 单价, 单位, 金额, 类型, 日期, 数量, 项目名称) VALUES (?, ?, ?, ?, ?" & _
", ?, ?, ?)"
Me.OleDbInsertCommand1.Connection = Me.OleDbConnection1
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("备注", System.Data.OleDb.OleDbType.VarWChar, 50, "备注"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("单价", System.Data.OleDb.OleDbType.VarWChar, 10, "单价"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("单位", System.Data.OleDb.OleDbType.VarWChar, 5, "单位"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("金额", System.Data.OleDb.OleDbType.VarWChar, 20, "金额"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("类型", System.Data.OleDb.OleDbType.VarWChar, 10, "类型"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("日期", System.Data.OleDb.OleDbType.VarWChar, 20, "日期"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("数量", System.Data.OleDb.OleDbType.VarWChar, 10, "数量"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("项目名称", System.Data.OleDb.OleDbType.VarWChar, 15, "项目名称"))
'
'OleDbConnection1
'
Me.OleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=finance.md" & _
"b;Mode=Share Deny None;Extended Properties="""";Jet OLEDB:System database="""";Jet O" & _
"LEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=5;Jet" & _
" OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Glo" & _
"bal Bulk Transactions=1;Jet OLEDB:New Database Password="""";Jet OLEDB:Create Syst" & _
"em Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale o" & _
"n Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=Fal" & _
"se"
'
'OleDbSelectCommand1
'
Me.OleDbSelectCommand1.CommandText = "SELECT 备注, 单价, 单位, 金额, 类型, 日期, 数量, 项目名称 FROM OutgoingTable"
Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
'
'Button5
'
Me.Button5.Location = New System.Drawing.Point(512, 400)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(72, 24)
Me.Button5.TabIndex = 24
Me.Button5.Text = "关闭"
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(568, 352)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(56, 32)
Me.Button4.TabIndex = 23
Me.Button4.Text = "取消"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(472, 352)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(56, 32)
Me.Button3.TabIndex = 22
Me.Button3.Text = "修改"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(568, 296)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(56, 32)
Me.Button2.TabIndex = 21
Me.Button2.Text = "删除"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(472, 296)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(56, 32)
Me.Button1.TabIndex = 20
Me.Button1.Text = "增加"
'
'ComboBox1
'
Me.ComboBox1.DataSource = Me.DataSet11.Outgoing
Me.ComboBox1.DisplayMember = "项目名称"
Me.ComboBox1.Location = New System.Drawing.Point(88, 328)
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(120, 21)
Me.ComboBox1.TabIndex = 31
Me.ComboBox1.Text = "System.Data.DataViewManagerListItemTypeDescriptor"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -