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
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'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.
Friend WithEvents lblFirstName As System.Windows.Forms.Label
Friend WithEvents lblLastName As System.Windows.Forms.Label
Friend WithEvents lblAddress As System.Windows.Forms.Label
Friend WithEvents txtFirstName As System.Windows.Forms.TextBox
Friend WithEvents txtLastName As System.Windows.Forms.TextBox
Friend WithEvents txtAddress As System.Windows.Forms.TextBox
Friend WithEvents btnSubmit As System.Windows.Forms.Button
Friend WithEvents odbconSam As System.Data.OleDb.OleDbConnection
Friend WithEvents odbdaSample As System.Data.OleDb.OleDbDataAdapter
Friend WithEvents DsSample1 As Sample.dsSample
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.lblFirstName = New System.Windows.Forms.Label()
Me.lblLastName = New System.Windows.Forms.Label()
Me.lblAddress = New System.Windows.Forms.Label()
Me.txtFirstName = New System.Windows.Forms.TextBox()
Me.txtLastName = New System.Windows.Forms.TextBox()
Me.txtAddress = New System.Windows.Forms.TextBox()
Me.btnSubmit = New System.Windows.Forms.Button()
Me.odbconSam = New System.Data.OleDb.OleDbConnection()
Me.odbdaSample = New System.Data.OleDb.OleDbDataAdapter()
Me.DsSample1 = New Sample.dsSample()
CType(Me.DsSample1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'lblFirstName
'
Me.lblFirstName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.lblFirstName.Location = New System.Drawing.Point(72, 32)
Me.lblFirstName.Name = "lblFirstName"
Me.lblFirstName.Size = New System.Drawing.Size(104, 32)
Me.lblFirstName.TabIndex = 0
Me.lblFirstName.Text = "FirstName"
'
'lblLastName
'
Me.lblLastName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.lblLastName.Location = New System.Drawing.Point(72, 80)
Me.lblLastName.Name = "lblLastName"
Me.lblLastName.Size = New System.Drawing.Size(104, 32)
Me.lblLastName.TabIndex = 1
Me.lblLastName.Text = "LastName"
'
'lblAddress
'
Me.lblAddress.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.lblAddress.Location = New System.Drawing.Point(72, 128)
Me.lblAddress.Name = "lblAddress"
Me.lblAddress.Size = New System.Drawing.Size(104, 32)
Me.lblAddress.TabIndex = 2
Me.lblAddress.Text = "Address:"
'
'txtFirstName
'
Me.txtFirstName.Location = New System.Drawing.Point(200, 32)
Me.txtFirstName.Multiline = True
Me.txtFirstName.Name = "txtFirstName"
Me.txtFirstName.Size = New System.Drawing.Size(112, 32)
Me.txtFirstName.TabIndex = 3
Me.txtFirstName.Text = ""
'
'txtLastName
'
Me.txtLastName.Location = New System.Drawing.Point(200, 80)
Me.txtLastName.Multiline = True
Me.txtLastName.Name = "txtLastName"
Me.txtLastName.Size = New System.Drawing.Size(112, 32)
Me.txtLastName.TabIndex = 4
Me.txtLastName.Text = ""
'
'txtAddress
'
Me.txtAddress.Location = New System.Drawing.Point(200, 128)
Me.txtAddress.Multiline = True
Me.txtAddress.Name = "txtAddress"
Me.txtAddress.Size = New System.Drawing.Size(112, 32)
Me.txtAddress.TabIndex = 5
Me.txtAddress.Text = ""
'
'btnSubmit
'
Me.btnSubmit.Location = New System.Drawing.Point(72, 200)
Me.btnSubmit.Name = "btnSubmit"
Me.btnSubmit.Size = New System.Drawing.Size(112, 40)
Me.btnSubmit.TabIndex = 6
Me.btnSubmit.Text = "Submit"
'
'odbconSam
'
Me.odbconSam.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=Z:\course\" & _
"Chapter.04\Data\sample.mdb;Mode=Share Deny None;Extended Properties="""";Jet OLEDB" & _
":System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Je" & _
"t OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial" & _
" Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password" & _
"="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet " & _
"OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repai" & _
"r=False;Jet OLEDB:SFP=False"
'
'odbdaSample
'
Me.odbdaSample.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "tblSample", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("fldAddress", "fldAddress"), New System.Data.Common.DataColumnMapping("fldFirstName", "fldFirstName"), New System.Data.Common.DataColumnMapping("fldLastName", "fldLastName")})})
'
'DsSample1
'
Me.DsSample1.DataSetName = "dsSample"
Me.DsSample1.Locale = New System.Globalization.CultureInfo("en-US")
Me.DsSample1.Namespace = "http://www.tempuri.org/dsSample.xsd"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(584, 469)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnSubmit, Me.txtAddress, Me.txtLastName, Me.txtFirstName, Me.lblAddress, Me.lblLastName, Me.lblFirstName})
Me.Name = "Form1"
Me.Text = "Form1"
CType(Me.DsSample1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim pbndTemp As Binding, pintRecords As Integer
pintRecords = odbdaSample.Fill(DsSample1)
pbndTemp = New Binding("Text", DsSample1, "tblSample.fldFirstName")
txtFirstName.DataBindings.Add(pbndTemp)
pbndTemp = New Binding("Text", DsSample1, "tblSample.fldLastName")
txtLastName.DataBindings.Add(pbndTemp)
pbndTemp = New Binding("Text", DsSample1, "tblSample.Address")
txtAddress.DataBindings.Add(pbndTemp)
End Sub
End Class