⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 depot2.vb

📁 vb。net 2003数据库设计整套源代码
💻 VB
字号:
Public Class depot2
    Inherits System.Windows.Forms.Form

#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 Label1 As System.Windows.Forms.Label
    Friend WithEvents Btworkershow As System.Windows.Forms.Button
    Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
    Friend WithEvents DataGrid2 As System.Windows.Forms.DataGrid
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents btasshow As System.Windows.Forms.Button
    Friend WithEvents OleDbDataAdapter1 As System.Data.OleDb.OleDbDataAdapter
    Friend WithEvents OleDbSelectCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbInsertCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbConnection1 As System.Data.OleDb.OleDbConnection
    Friend WithEvents Ds2worker1 As 仓库管理系统.Ds2worker
    Friend WithEvents OleDbDataAdapter2 As System.Data.OleDb.OleDbDataAdapter
    Friend WithEvents OleDbSelectCommand2 As System.Data.OleDb.OleDbCommand
    Friend WithEvents Ds2accessory1 As 仓库管理系统.Ds2accessory
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Label1 = New System.Windows.Forms.Label
        Me.Btworkershow = New System.Windows.Forms.Button
        Me.DataGrid1 = New System.Windows.Forms.DataGrid
        Me.Ds2worker1 = New 仓库管理系统.Ds2worker
        Me.DataGrid2 = New System.Windows.Forms.DataGrid
        Me.Ds2accessory1 = New 仓库管理系统.Ds2accessory
        Me.Label2 = New System.Windows.Forms.Label
        Me.btasshow = New System.Windows.Forms.Button
        Me.OleDbDataAdapter1 = 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.OleDbDataAdapter2 = New System.Data.OleDb.OleDbDataAdapter
        Me.OleDbSelectCommand2 = New System.Data.OleDb.OleDbCommand
        CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.Ds2worker1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.DataGrid2, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.Ds2accessory1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.Font = New System.Drawing.Font("隶书", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.Label1.Location = New System.Drawing.Point(8, 0)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(200, 16)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "仓库012中的职工信息"
        '
        'Btworkershow
        '
        Me.Btworkershow.Location = New System.Drawing.Point(208, 0)
        Me.Btworkershow.Name = "Btworkershow"
        Me.Btworkershow.TabIndex = 1
        Me.Btworkershow.Text = "显示"
        '
        'DataGrid1
        '
        Me.DataGrid1.DataMember = "worker"
        Me.DataGrid1.DataSource = Me.Ds2worker1
        Me.DataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.DataGrid1.Location = New System.Drawing.Point(0, 24)
        Me.DataGrid1.Name = "DataGrid1"
        Me.DataGrid1.Size = New System.Drawing.Size(304, 160)
        Me.DataGrid1.TabIndex = 2
        '
        'Ds2worker1
        '
        Me.Ds2worker1.DataSetName = "Ds2worker"
        Me.Ds2worker1.Locale = New System.Globalization.CultureInfo("zh-CN")
        '
        'DataGrid2
        '
        Me.DataGrid2.DataMember = "accessory"
        Me.DataGrid2.DataSource = Me.Ds2accessory1
        Me.DataGrid2.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.DataGrid2.Location = New System.Drawing.Point(0, 216)
        Me.DataGrid2.Name = "DataGrid2"
        Me.DataGrid2.Size = New System.Drawing.Size(304, 144)
        Me.DataGrid2.TabIndex = 3
        '
        'Ds2accessory1
        '
        Me.Ds2accessory1.DataSetName = "Ds2accessory"
        Me.Ds2accessory1.Locale = New System.Globalization.CultureInfo("zh-CN")
        '
        'Label2
        '
        Me.Label2.Font = New System.Drawing.Font("隶书", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.Label2.Location = New System.Drawing.Point(0, 192)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(200, 16)
        Me.Label2.TabIndex = 4
        Me.Label2.Text = "仓库012中的零件信息"
        '
        'btasshow
        '
        Me.btasshow.Location = New System.Drawing.Point(208, 192)
        Me.btasshow.Name = "btasshow"
        Me.btasshow.TabIndex = 5
        Me.btasshow.Text = "显示"
        '
        'OleDbDataAdapter1
        '
        Me.OleDbDataAdapter1.InsertCommand = Me.OleDbInsertCommand1
        Me.OleDbDataAdapter1.SelectCommand = Me.OleDbSelectCommand1
        Me.OleDbDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "worker", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("wno", "wno"), New System.Data.Common.DataColumnMapping("wname", "wname"), New System.Data.Common.DataColumnMapping("title", "title"), New System.Data.Common.DataColumnMapping("age", "age")})})
        '
        'OleDbInsertCommand1
        '
        Me.OleDbInsertCommand1.CommandText = "INSERT INTO worker(wno, wname, title, age) VALUES (?, ?, ?, ?)"
        Me.OleDbInsertCommand1.Connection = Me.OleDbConnection1
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("wno", System.Data.OleDb.OleDbType.VarWChar, 8, "wno"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("wname", System.Data.OleDb.OleDbType.VarWChar, 11, "wname"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("title", System.Data.OleDb.OleDbType.VarWChar, 5, "title"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("age", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(10, Byte), CType(0, Byte), "age", System.Data.DataRowVersion.Current, Nothing))
        '
        'OleDbConnection1
        '
        Me.OleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=C:\depot.m" & _
        "db;Mode=Share Deny None;Extended Properties="""";Jet OLEDB:System database="""";Jet " & _
        "OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=5;Je" & _
        "t OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Gl" & _
        "obal Bulk Transactions=1;Jet OLEDB:New Database Password="""";Jet OLEDB:Create Sys" & _
        "tem Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale " & _
        "on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=Fa" & _
        "lse"
        '
        'OleDbSelectCommand1
        '
        Me.OleDbSelectCommand1.CommandText = "SELECT wno, wname, title, age FROM worker WHERE (sno = '012')"
        Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
        '
        'OleDbDataAdapter2
        '
        Me.OleDbDataAdapter2.SelectCommand = Me.OleDbSelectCommand2
        Me.OleDbDataAdapter2.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "accessory", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("ano", "ano"), New System.Data.Common.DataColumnMapping("descript", "descript"), New System.Data.Common.DataColumnMapping("price", "price"), New System.Data.Common.DataColumnMapping("stand", "stand"), New System.Data.Common.DataColumnMapping("aname", "aname"), New System.Data.Common.DataColumnMapping("anount", "anount")})})
        '
        'OleDbSelectCommand2
        '
        Me.OleDbSelectCommand2.CommandText = "SELECT store.ano, accessory.descript, accessory.price, accessory.stand, accessory" & _
        ".aname, store.anount FROM accessory INNER JOIN store ON accessory.ano = store.an" & _
        "o WHERE (store.sno = '012')"
        Me.OleDbSelectCommand2.Connection = Me.OleDbConnection1
        '
        'depot2
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(304, 389)
        Me.Controls.Add(Me.btasshow)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.DataGrid2)
        Me.Controls.Add(Me.DataGrid1)
        Me.Controls.Add(Me.Btworkershow)
        Me.Controls.Add(Me.Label1)
        Me.Name = "depot2"
        Me.Text = "第一仓库"
        CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.Ds2worker1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.DataGrid2, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.Ds2accessory1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub Btworkershow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btworkershow.Click
        Ds2worker1.Clear()
        OleDbDataAdapter1.Fill(Ds2worker1)

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btasshow.Click
        Ds2accessory1.Clear()
        OleDbDataAdapter2.Fill(Ds2accessory1)
    End Sub
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -