HI Bernie,
Thanks for responding.
1. None of the textbox fields update. The dbbank1.hasChanges comes up
False. This happens even if the values in the text box have changed and
the dataset shows the change in that column.
2. Here is the code:
************ Code **************************
Public Class frmBankMnt
Inherits System.Windows.Forms.Form
Dim ws As New BanksClient.localhost.BankService
Dim addmntflag As addmntflag 'holds passed values and enum on
adding\mnt
#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 DsBank1 As BanksClient.localhost.dsBank
Friend WithEvents btnSave As System.Windows.Forms.Button
Friend WithEvents btnCancel As System.Windows.Forms.Button
Friend WithEvents txtBankName As System.Windows.Forms.TextBox
Friend WithEvents txtContactName As System.Windows.Forms.TextBox
Friend WithEvents txtEmailAddress As System.Windows.Forms.TextBox
Friend WithEvents txtPhoneNbr As System.Windows.Forms.TextBox
Friend WithEvents txtAddress As System.Windows.Forms.TextBox
Friend WithEvents Label1 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 Label7 As System.Windows.Forms.Label
Friend WithEvents Label8 As System.Windows.Forms.Label
Friend WithEvents txtFax As System.Windows.Forms.TextBox
Friend WithEvents txtCity As System.Windows.Forms.TextBox
Friend WithEvents txtState As System.Windows.Forms.TextBox
Friend WithEvents txtZip As System.Windows.Forms.TextBox
Friend WithEvents txtLastUpdate As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.DsBank1 = New BanksClient.localhost.dsBank
Me.btnSave = New System.Windows.Forms.Button
Me.btnCancel = New System.Windows.Forms.Button
Me.txtBankName = New System.Windows.Forms.TextBox
Me.txtContactName = New System.Windows.Forms.TextBox
Me.txtEmailAddress = New System.Windows.Forms.TextBox
Me.txtPhoneNbr = New System.Windows.Forms.TextBox
Me.txtFax = New System.Windows.Forms.TextBox
Me.txtAddress = New System.Windows.Forms.TextBox
Me.txtCity = New System.Windows.Forms.TextBox
Me.txtState = New System.Windows.Forms.TextBox
Me.txtZip = New System.Windows.Forms.TextBox
Me.txtLastUpdate = New System.Windows.Forms.TextBox
Me.Label1 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.Label5 = New System.Windows.Forms.Label
Me.Label6 = New System.Windows.Forms.Label
Me.Label7 = New System.Windows.Forms.Label
Me.Label8 = New System.Windows.Forms.Label
CType(Me.DsBank1,
System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'DsBank1
'
Me.DsBank1.DataSetName = "dsBank"
Me.DsBank1.Locale = New
System.Globalization.CultureInfo("en-US")
'
'btnSave
'
Me.btnSave.Location = New System.Drawing.Point(139, 224)
Me.btnSave.Name = "btnSave"
Me.btnSave.TabIndex = 1
Me.btnSave.Text = "Save"
'
'btnCancel
'
Me.btnCancel.Location = New System.Drawing.Point(275, 224)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.TabIndex = 2
Me.btnCancel.Text = "Cancel"
'
'txtBankName
'
Me.txtBankName.DataBindings.Add(New
System.Windows.Forms.Binding("Text", Me.DsBank1, "Bank.BankName"))
Me.txtBankName.Location = New System.Drawing.Point(112, 24)
Me.txtBankName.Name = "txtBankName"
Me.txtBankName.Size = New System.Drawing.Size(368, 20)
Me.txtBankName.TabIndex = 3
Me.txtBankName.Text = ""
'
'txtContactName
'
Me.txtContactName.DataBindings.Add(New
System.Windows.Forms.Binding("Text", Me.DsBank1, "Bank.ContactName"))
Me.txtContactName.Location = New System.Drawing.Point(112, 48)
Me.txtContactName.Name = "txtContactName"
Me.txtContactName.Size = New System.Drawing.Size(368, 20)
Me.txtContactName.TabIndex = 4
Me.txtContactName.Text = ""
'
'txtEmailAddress
'
Me.txtEmailAddress.DataBindings.Add(New
System.Windows.Forms.Binding("Text", Me.DsBank1, "Bank.EMailAddress"))
Me.txtEmailAddress.Location = New System.Drawing.Point(112, 72)
Me.txtEmailAddress.Name = "txtEmailAddress"
Me.txtEmailAddress.Size = New System.Drawing.Size(288, 20)
Me.txtEmailAddress.TabIndex = 5
Me.txtEmailAddress.Text = ""
'
'txtPhoneNbr
'
Me.txtPhoneNbr.DataBindings.Add(New
System.Windows.Forms.Binding("Text", Me.DsBank1, "Bank.PhoneNumber"))
Me.txtPhoneNbr.Location = New System.Drawing.Point(112, 96)
Me.txtPhoneNbr.Name = "txtPhoneNbr"
Me.txtPhoneNbr.Size = New System.Drawing.Size(144, 20)
Me.txtPhoneNbr.TabIndex = 6
Me.txtPhoneNbr.Text = ""
'
'txtFax
'
Me.txtFax.DataBindings.Add(New
System.Windows.Forms.Binding("Text", Me.DsBank1, "Bank.Fax"))
Me.txtFax.Location = New System.Drawing.Point(368, 96)
Me.txtFax.Name = "txtFax"
Me.txtFax.Size = New System.Drawing.Size(112, 20)
Me.txtFax.TabIndex = 7
Me.txtFax.Text = ""
'
'txtAddress
'
Me.txtAddress.DataBindings.Add(New
System.Windows.Forms.Binding("Text", Me.DsBank1, "Bank.Address"))
Me.txtAddress.Location = New System.Drawing.Point(112, 128)
Me.txtAddress.Name = "txtAddress"
Me.txtAddress.Size = New System.Drawing.Size(368, 20)
Me.txtAddress.TabIndex = 8
Me.txtAddress.Text = ""
'
'txtCity
'
Me.txtCity.DataBindings.Add(New
System.Windows.Forms.Binding("Text", Me.DsBank1, "Bank.City"))
Me.txtCity.Location = New System.Drawing.Point(112, 152)
Me.txtCity.Name = "txtCity"
Me.txtCity.Size = New System.Drawing.Size(224, 20)
Me.txtCity.TabIndex = 9
Me.txtCity.Text = ""
'
'txtState
'
Me.txtState.DataBindings.Add(New
System.Windows.Forms.Binding("Text", Me.DsBank1, "Bank.State"))
Me.txtState.Location = New System.Drawing.Point(344, 152)
Me.txtState.Name = "txtState"
Me.txtState.Size = New System.Drawing.Size(24, 20)
Me.txtState.TabIndex = 10
Me.txtState.Text = ""
'
'txtZip
'
Me.txtZip.DataBindings.Add(New
System.Windows.Forms.Binding("Text", Me.DsBank1, "Bank.Zip"))
Me.txtZip.Location = New System.Drawing.Point(376, 152)
Me.txtZip.Name = "txtZip"
Me.txtZip.TabIndex = 11
Me.txtZip.Text = ""
'
'txtLastUpdate
'
Me.txtLastUpdate.DataBindings.Add(New
System.Windows.Forms.Binding("Text", Me.DsBank1, "Bank.LastUpdate"))
Me.txtLastUpdate.Location = New System.Drawing.Point(304, 184)
Me.txtLastUpdate.Name = "txtLastUpdate"
Me.txtLastUpdate.TabIndex = 12
Me.txtLastUpdate.Text = ""
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(176, 184)
Me.Label1.Name = "Label1"
Me.Label1.TabIndex = 13
Me.Label1.Text = "Last Update"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(8, 128)
Me.Label3.Name = "Label3"
Me.Label3.TabIndex = 15
Me.Label3.Text = "Address"
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(328, 96)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(32, 23)
Me.Label4.TabIndex = 16
Me.Label4.Text = "Fax"
'
'Label5
'
Me.Label5.Location = New System.Drawing.Point(8, 96)
Me.Label5.Name = "Label5"
Me.Label5.TabIndex = 17
Me.Label5.Text = "Phone"
'
'Label6
'
Me.Label6.Location = New System.Drawing.Point(8, 72)
Me.Label6.Name = "Label6"
Me.Label6.TabIndex = 18
Me.Label6.Text = "E-Mail Address"
'
'Label7
'
Me.Label7.Location = New System.Drawing.Point(8, 48)
Me.Label7.Name = "Label7"
Me.Label7.TabIndex = 19
Me.Label7.Text = "Contact Name"
'
'Label8
'
Me.Label8.Location = New System.Drawing.Point(8, 24)
Me.Label8.Name = "Label8"
Me.Label8.TabIndex = 20
Me.Label8.Text = "Bank Name"
'
'frmBankMnt
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(488, 273)
Me.Controls.Add(Me.Label8)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.txtLastUpdate)
Me.Controls.Add(Me.txtZip)
Me.Controls.Add(Me.txtState)
Me.Controls.Add(Me.txtCity)
Me.Controls.Add(Me.txtAddress)
Me.Controls.Add(Me.txtFax)
Me.Controls.Add(Me.txtPhoneNbr)
Me.Controls.Add(Me.txtEmailAddress)
Me.Controls.Add(Me.txtContactName)
Me.Controls.Add(Me.txtBankName)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnSave)
Me.Name = "frmBankMnt"
Me.Text = "Bank Entry and Editing"
CType(Me.DsBank1,
System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub frmAddMnt_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
ws.Credentials = System.Net.CredentialCache.DefaultCredentials
DsBank1.Merge(ws.GetAllBanks)
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave.Click
DsBank1.GetChanges()
If DsBank1.HasChanges() Then
ws.Credentials =
System.Net.CredentialCache.DefaultCredentials
Dim diffBank As New BanksClient.localhost.dsBank
'creates a dataset that holds the differences
'diffBank.Merge(DsBank1.GetChanges())
'puts the changes into this new dataset from dsbank1
diffBank = ws.UpdateBank(DsBank1) 'updates through the web
service
DsBank1.Merge(diffBank)
'changes are refreshed on dsbank1 it looks like.
End If
End Sub
Private Sub frmBankMnt_Disposed(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Disposed, btnCancel.Click
Me.Dispose()
End Sub
Private Sub txtFax_TextChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles txtFax.TextChanged
Debug.Write("Has changes? " & DsBank1.HasChanges.ToString)
'This always comes up false.
End Sub
End Class