HI Bernie,
Thanks for responding.
1. None of the textbox fields update. The dbbank1.hasChan ges 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.loc alhost.BankServ ice
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.
InitializeCompo nent()
'Add any initialization after the InitializeCompo nent() 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.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er
'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.loc alhost.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.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
Me.DsBank1 = New BanksClient.loc alhost.dsBank
Me.btnSave = New System.Windows. Forms.Button
Me.btnCancel = New System.Windows. Forms.Button
Me.txtBankName = New System.Windows. Forms.TextBox
Me.txtContactNa me = New System.Windows. Forms.TextBox
Me.txtEmailAddr ess = 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.txtLastUpdat e = 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.DsBank 1,
System.Componen tModel.ISupport Initialize).Beg inInit()
Me.SuspendLayou t()
'
'DsBank1
'
Me.DsBank1.Data SetName = "dsBank"
Me.DsBank1.Loca le = New
System.Globaliz ation.CultureIn fo("en-US")
'
'btnSave
'
Me.btnSave.Loca tion = New System.Drawing. Point(139, 224)
Me.btnSave.Name = "btnSave"
Me.btnSave.TabI ndex = 1
Me.btnSave.Text = "Save"
'
'btnCancel
'
Me.btnCancel.Lo cation = New System.Drawing. Point(275, 224)
Me.btnCancel.Na me = "btnCancel"
Me.btnCancel.Ta bIndex = 2
Me.btnCancel.Te xt = "Cancel"
'
'txtBankName
'
Me.txtBankName. DataBindings.Ad d(New
System.Windows. Forms.Binding(" Text", Me.DsBank1, "Bank.BankName" ))
Me.txtBankName. Location = New System.Drawing. Point(112, 24)
Me.txtBankName. Name = "txtBankNam e"
Me.txtBankName. Size = New System.Drawing. Size(368, 20)
Me.txtBankName. TabIndex = 3
Me.txtBankName. Text = ""
'
'txtContactName
'
Me.txtContactNa me.DataBindings .Add(New
System.Windows. Forms.Binding(" Text", Me.DsBank1, "Bank.ContactNa me"))
Me.txtContactNa me.Location = New System.Drawing. Point(112, 48)
Me.txtContactNa me.Name = "txtContactName "
Me.txtContactNa me.Size = New System.Drawing. Size(368, 20)
Me.txtContactNa me.TabIndex = 4
Me.txtContactNa me.Text = ""
'
'txtEmailAddres s
'
Me.txtEmailAddr ess.DataBinding s.Add(New
System.Windows. Forms.Binding(" Text", Me.DsBank1, "Bank.EMailAddr ess"))
Me.txtEmailAddr ess.Location = New System.Drawing. Point(112, 72)
Me.txtEmailAddr ess.Name = "txtEmailAddres s"
Me.txtEmailAddr ess.Size = New System.Drawing. Size(288, 20)
Me.txtEmailAddr ess.TabIndex = 5
Me.txtEmailAddr ess.Text = ""
'
'txtPhoneNbr
'
Me.txtPhoneNbr. DataBindings.Ad d(New
System.Windows. Forms.Binding(" Text", Me.DsBank1, "Bank.PhoneNumb er"))
Me.txtPhoneNbr. Location = New System.Drawing. Point(112, 96)
Me.txtPhoneNbr. Name = "txtPhoneNb r"
Me.txtPhoneNbr. Size = New System.Drawing. Size(144, 20)
Me.txtPhoneNbr. TabIndex = 6
Me.txtPhoneNbr. Text = ""
'
'txtFax
'
Me.txtFax.DataB indings.Add(New
System.Windows. Forms.Binding(" Text", Me.DsBank1, "Bank.Fax") )
Me.txtFax.Locat ion = New System.Drawing. Point(368, 96)
Me.txtFax.Name = "txtFax"
Me.txtFax.Size = New System.Drawing. Size(112, 20)
Me.txtFax.TabIn dex = 7
Me.txtFax.Text = ""
'
'txtAddress
'
Me.txtAddress.D ataBindings.Add (New
System.Windows. Forms.Binding(" Text", Me.DsBank1, "Bank.Address") )
Me.txtAddress.L ocation = New System.Drawing. Point(112, 128)
Me.txtAddress.N ame = "txtAddress "
Me.txtAddress.S ize = New System.Drawing. Size(368, 20)
Me.txtAddress.T abIndex = 8
Me.txtAddress.T ext = ""
'
'txtCity
'
Me.txtCity.Data Bindings.Add(Ne w
System.Windows. Forms.Binding(" Text", Me.DsBank1, "Bank.City" ))
Me.txtCity.Loca tion = New System.Drawing. Point(112, 152)
Me.txtCity.Name = "txtCity"
Me.txtCity.Size = New System.Drawing. Size(224, 20)
Me.txtCity.TabI ndex = 9
Me.txtCity.Text = ""
'
'txtState
'
Me.txtState.Dat aBindings.Add(N ew
System.Windows. Forms.Binding(" Text", Me.DsBank1, "Bank.State "))
Me.txtState.Loc ation = New System.Drawing. Point(344, 152)
Me.txtState.Nam e = "txtState"
Me.txtState.Siz e = New System.Drawing. Size(24, 20)
Me.txtState.Tab Index = 10
Me.txtState.Tex t = ""
'
'txtZip
'
Me.txtZip.DataB indings.Add(New
System.Windows. Forms.Binding(" Text", Me.DsBank1, "Bank.Zip") )
Me.txtZip.Locat ion = New System.Drawing. Point(376, 152)
Me.txtZip.Name = "txtZip"
Me.txtZip.TabIn dex = 11
Me.txtZip.Text = ""
'
'txtLastUpdate
'
Me.txtLastUpdat e.DataBindings. Add(New
System.Windows. Forms.Binding(" Text", Me.DsBank1, "Bank.LastUpdat e"))
Me.txtLastUpdat e.Location = New System.Drawing. Point(304, 184)
Me.txtLastUpdat e.Name = "txtLastUpd ate"
Me.txtLastUpdat e.TabIndex = 12
Me.txtLastUpdat e.Text = ""
'
'Label1
'
Me.Label1.Locat ion = New System.Drawing. Point(176, 184)
Me.Label1.Name = "Label1"
Me.Label1.TabIn dex = 13
Me.Label1.Text = "Last Update"
'
'Label3
'
Me.Label3.Locat ion = New System.Drawing. Point(8, 128)
Me.Label3.Name = "Label3"
Me.Label3.TabIn dex = 15
Me.Label3.Text = "Address"
'
'Label4
'
Me.Label4.Locat ion = New System.Drawing. Point(328, 96)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing. Size(32, 23)
Me.Label4.TabIn dex = 16
Me.Label4.Text = "Fax"
'
'Label5
'
Me.Label5.Locat ion = New System.Drawing. Point(8, 96)
Me.Label5.Name = "Label5"
Me.Label5.TabIn dex = 17
Me.Label5.Text = "Phone"
'
'Label6
'
Me.Label6.Locat ion = New System.Drawing. Point(8, 72)
Me.Label6.Name = "Label6"
Me.Label6.TabIn dex = 18
Me.Label6.Text = "E-Mail Address"
'
'Label7
'
Me.Label7.Locat ion = New System.Drawing. Point(8, 48)
Me.Label7.Name = "Label7"
Me.Label7.TabIn dex = 19
Me.Label7.Text = "Contact Name"
'
'Label8
'
Me.Label8.Locat ion = New System.Drawing. Point(8, 24)
Me.Label8.Name = "Label8"
Me.Label8.TabIn dex = 20
Me.Label8.Text = "Bank Name"
'
'frmBankMnt
'
Me.AutoScaleBas eSize = 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.txtLastUpda te)
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.txtEmailAdd ress)
Me.Controls.Add (Me.txtContactN ame)
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.DsBank 1,
System.Componen tModel.ISupport Initialize).End Init()
Me.ResumeLayout (False)
End Sub
#End Region
Private Sub frmAddMnt_Load( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
ws.Credentials = System.Net.Cred entialCache.Def aultCredentials
DsBank1.Merge(w s.GetAllBanks)
End Sub
Private Sub btnSave_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnSave.Click
DsBank1.GetChan ges()
If DsBank1.HasChan ges() Then
ws.Credentials =
System.Net.Cred entialCache.Def aultCredentials
Dim diffBank As New BanksClient.loc alhost.dsBank
'creates a dataset that holds the differences
'diffBank.Merge (DsBank1.GetCha nges())
'puts the changes into this new dataset from dsbank1
diffBank = ws.UpdateBank(D sBank1) 'updates through the web
service
DsBank1.Merge(d iffBank)
'changes are refreshed on dsbank1 it looks like.
End If
End Sub
Private Sub frmBankMnt_Disp osed(ByVal sender As Object, ByVal e As
System.EventArg s) Handles MyBase.Disposed , btnCancel.Click
Me.Dispose()
End Sub
Private Sub txtFax_TextChan ged(ByVal sender As System.Object, ByVal
e As System.EventArg s) Handles txtFax.TextChan ged
Debug.Write("Ha s changes? " & DsBank1.HasChan ges.ToString)
'This always comes up false.
End Sub
End Class
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!