📄 customerform.vb
字号:
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 OleDbConnection1 As System.Data.OleDb.OleDbConnection
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 OleDbUpdateCommand1 As System.Data.OleDb.OleDbCommand
Friend WithEvents OleDbDeleteCommand1 As System.Data.OleDb.OleDbCommand
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 TextBox4 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
Friend WithEvents DACustomers As System.Data.SqlClient.SqlDataAdapter
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
Friend WithEvents DsCustomers1 As LookupCustomers.DSCustomers
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 bttnFirst As System.Windows.Forms.Button
Friend WithEvents bttnPrevious As System.Windows.Forms.Button
Friend WithEvents bttnNext As System.Windows.Forms.Button
Friend WithEvents bttnLast As System.Windows.Forms.Button
Friend WithEvents lblPosition As System.Windows.Forms.Label
'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.Label4 = New System.Windows.Forms.Label()
Me.DsCustomers1 = New LookupCustomers.DSCustomers()
Me.Label1 = New System.Windows.Forms.Label()
Me.bttnLast = New System.Windows.Forms.Button()
Me.Label3 = New System.Windows.Forms.Label()
Me.SqlDeleteCommand1 = New System.Data.SqlClient.SqlCommand()
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection()
Me.Button2 = New System.Windows.Forms.Button()
Me.Label2 = New System.Windows.Forms.Label()
Me.bttnNext = New System.Windows.Forms.Button()
Me.lblPosition = New System.Windows.Forms.Label()
Me.SqlUpdateCommand1 = New System.Data.SqlClient.SqlCommand()
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand()
Me.DACustomers = New System.Data.SqlClient.SqlDataAdapter()
Me.SqlInsertCommand1 = New System.Data.SqlClient.SqlCommand()
Me.TextBox2 = New System.Windows.Forms.TextBox()
Me.TextBox3 = New System.Windows.Forms.TextBox()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.TextBox4 = New System.Windows.Forms.TextBox()
Me.bttnFirst = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button()
Me.bttnPrevious = New System.Windows.Forms.Button()
CType(Me.DsCustomers1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Label4
'
Me.Label4.Font = New System.Drawing.Font("Verdana", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.Location = New System.Drawing.Point(10, 48)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(100, 16)
Me.Label4.TabIndex = 9
Me.Label4.Text = "Company"
'
'DsCustomers1
'
Me.DsCustomers1.DataSetName = "DSCustomers"
Me.DsCustomers1.Locale = New System.Globalization.CultureInfo("en-US")
Me.DsCustomers1.Namespace = "http://www.tempuri.org/DSCustomers.xsd"
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("Verdana", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(10, 8)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(100, 16)
Me.Label1.TabIndex = 9
Me.Label1.Text = "CustomerID"
'
'bttnLast
'
Me.bttnLast.Font = New System.Drawing.Font("Verdana", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.bttnLast.Location = New System.Drawing.Point(250, 192)
Me.bttnLast.Name = "bttnLast"
Me.bttnLast.Size = New System.Drawing.Size(40, 24)
Me.bttnLast.TabIndex = 7
Me.bttnLast.Text = ">>"
'
'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(10, 128)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(100, 16)
Me.Label3.TabIndex = 9
Me.Label3.Text = "Contact Title"
'
'SqlDeleteCommand1
'
Me.SqlDeleteCommand1.CommandText = "DELETE FROM dbo.Customers WHERE (CustomerID = @CustomerID) AND (Address = @Addres" & _
"s OR @Address1 IS NULL AND Address IS NULL) AND (City = @City OR @City1 IS NULL " & _
"AND City IS NULL) AND (CompanyName = @CompanyName) AND (ContactName = @ContactNa" & _
"me OR @ContactName1 IS NULL AND ContactName IS NULL) AND (ContactTitle = @Contac" & _
"tTitle OR @ContactTitle1 IS NULL AND ContactTitle IS NULL) AND (Country = @Count" & _
"ry OR @Country1 IS NULL AND Country IS NULL) AND (Fax = @Fax OR @Fax1 IS NULL AN" & _
"D Fax IS NULL) AND (Phone = @Phone OR @Phone1 IS NULL AND Phone IS NULL) AND (Po" & _
"stalCode = @PostalCode OR @PostalCode1 IS NULL AND PostalCode IS NULL) AND (Regi" & _
"on = @Region OR @Region1 IS NULL AND Region IS NULL)"
Me.SqlDeleteCommand1.Connection = Me.SqlConnection1
Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@CustomerID", System.Data.SqlDbType.NChar, 5, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CustomerID", System.Data.DataRowVersion.Original, Nothing))
Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Address", System.Data.SqlDbType.NVarChar, 60, System.Data.ParameterDirection.Input, True, CType(0, Byte), CType(0, Byte), "Address", System.Data.DataRowVersion.Original, Nothing))
Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Address1", System.Data.SqlDbType.NVarChar, 60, System.Data.ParameterDirection.Input, True, CType(0, Byte), CType(0, Byte), "Address", System.Data.DataRowVersion.Original, Nothing))
Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@City", System.Data.SqlDbType.NVarChar, 15, System.Data.ParameterDirection.Input, True, CType(0, Byte), CType(0, Byte), "City", System.Data.DataRowVersion.Original, Nothing))
Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@City1", System.Data.SqlDbType.NVarChar, 15, System.Data.ParameterDirection.Input, True, CType(0, Byte), CType(0, Byte), "City", System.Data.DataRowVersion.Original, Nothing))
Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@CompanyName", System.Data.SqlDbType.NVarChar, 40, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CompanyName", System.Data.DataRowVersion.Original, Nothing))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -