form1.vb
来自「Mastering VBNet Include Source Code」· VB 代码 · 共 417 行 · 第 1/3 页
VB
417 行
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
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
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
Friend WithEvents ComboBox2 As System.Windows.Forms.ComboBox
Friend WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
Friend WithEvents DAProducts As System.Data.SqlClient.SqlDataAdapter
Friend WithEvents DASuppliers As System.Data.SqlClient.SqlDataAdapter
Friend WithEvents DACategories As System.Data.SqlClient.SqlDataAdapter
Friend WithEvents SqlSelectCommand2 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlSelectCommand3 As System.Data.SqlClient.SqlCommand
Friend WithEvents DsProducts1 As Products.DSProducts
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlInsertCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlUpdateCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlDeleteCommand1 As System.Data.SqlClient.SqlCommand
'Required by the Windows Form Designer
Private components As System.ComponentModel.Container
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label3 = New System.Windows.Forms.Label()
Me.DACategories = New System.Data.SqlClient.SqlDataAdapter()
Me.SqlSelectCommand3 = New System.Data.SqlClient.SqlCommand()
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection()
Me.TextBox2 = New System.Windows.Forms.TextBox()
Me.DsProducts1 = New Products.DSProducts()
Me.TextBox3 = New System.Windows.Forms.TextBox()
Me.SqlInsertCommand1 = New System.Data.SqlClient.SqlCommand()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.DASuppliers = New System.Data.SqlClient.SqlDataAdapter()
Me.SqlSelectCommand2 = New System.Data.SqlClient.SqlCommand()
Me.Button2 = New System.Windows.Forms.Button()
Me.ComboBox2 = New System.Windows.Forms.ComboBox()
Me.ComboBox1 = New System.Windows.Forms.ComboBox()
Me.DAProducts = New System.Data.SqlClient.SqlDataAdapter()
Me.SqlDeleteCommand1 = New System.Data.SqlClient.SqlCommand()
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand()
Me.SqlUpdateCommand1 = New System.Data.SqlClient.SqlCommand()
Me.Button1 = New System.Windows.Forms.Button()
Me.ListBox1 = New System.Windows.Forms.ListBox()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label6 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
CType(Me.DsProducts1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Label3
'
Me.Label3.Font = New System.Drawing.Font("Verdana", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.Location = New System.Drawing.Point(208, 85)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(72, 16)
Me.Label3.TabIndex = 7
Me.Label3.Text = "Stock"
'
'DACategories
'
Me.DACategories.SelectCommand = Me.SqlSelectCommand3
Me.DACategories.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "Categories", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("CategoryID", "CategoryID"), New System.Data.Common.DataColumnMapping("CategoryName", "CategoryName")})})
'
'SqlSelectCommand3
'
Me.SqlSelectCommand3.CommandText = "SELECT CategoryID, CategoryName FROM dbo.Categories"
Me.SqlSelectCommand3.Connection = Me.SqlConnection1
'
'SqlConnection1
'
Me.SqlConnection1.ConnectionString = "data source=(local);initial catalog=Northwind;persist security info=False;user id" & _
"=sa;workstation id=PROTSERVER;packet size=4096"
'
'TextBox2
'
Me.TextBox2.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.DsProducts1, "Products.UnitPrice"))
Me.TextBox2.Font = New System.Drawing.Font("Verdana", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.TextBox2.Location = New System.Drawing.Point(296, 50)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(80, 22)
Me.TextBox2.TabIndex = 1
Me.TextBox2.Text = ""
'
'DsProducts1
'
Me.DsProducts1.DataSetName = "DSProducts"
Me.DsProducts1.Locale = New System.Globalization.CultureInfo("en-US")
Me.DsProducts1.Namespace = "http://www.tempuri.org/DSProducts.xsd"
'
'TextBox3
'
Me.TextBox3.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.DsProducts1, "Products.UnitsInStock"))
Me.TextBox3.Font = New System.Drawing.Font("Verdana", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.TextBox3.Location = New System.Drawing.Point(296, 84)
Me.TextBox3.Name = "TextBox3"
Me.TextBox3.Size = New System.Drawing.Size(48, 22)
Me.TextBox3.TabIndex = 2
Me.TextBox3.Text = ""
'
'SqlInsertCommand1
'
Me.SqlInsertCommand1.CommandText = "INSERT INTO dbo.Products(ProductName, SupplierID, CategoryID, QuantityPerUnit, Un" & _
"itPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued) VALUES (@Produc" & _
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?