Good morning all.
I am trying to add a new record via currencymanager and bound txt controls
My question is this:
How do I set new row fields which are not bound?
I have been trying this:
ds.Tables("Provider").NewRow.Item("Name") = providername
Which is obviously incorrect. could someone here put me straight please?
cheers
(slightly more detailed code below)
<binding stuff>
thisCurrencyManager = _
CType(Me.BindingContext(ds.Tables("Provider")), CurrencyManager)
thisCurrencyManager.Position = 0
<end binding stuff>
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Try
thisCurrencyManager.EndCurrentEdit()
thisCurrencyManager.AddNew()
Catch eEndEdit As System.Exception
System.Windows.Forms.MessageBox.Show(eEndEdit.Message)
End Try
End Sub
Private Sub btnRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefresh.Click
Dim providername As String = txtLname.Text & ", " & txtFname.Text
ds.Tables("Provider").NewRow.Item("Name") = providername
thisCurrencyManager.EndCurrentEdit()
DataGrid1.Refresh()
End Sub
Tracey
Remember... True happiness is not getting what you want...
Its wanting what you have got!
I am trying to add a new record via currencymanager and bound txt controls
My question is this:
How do I set new row fields which are not bound?
I have been trying this:
ds.Tables("Provider").NewRow.Item("Name") = providername
Which is obviously incorrect. could someone here put me straight please?
cheers
(slightly more detailed code below)
<binding stuff>
thisCurrencyManager = _
CType(Me.BindingContext(ds.Tables("Provider")), CurrencyManager)
thisCurrencyManager.Position = 0
<end binding stuff>
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Try
thisCurrencyManager.EndCurrentEdit()
thisCurrencyManager.AddNew()
Catch eEndEdit As System.Exception
System.Windows.Forms.MessageBox.Show(eEndEdit.Message)
End Try
End Sub
Private Sub btnRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefresh.Click
Dim providername As String = txtLname.Text & ", " & txtFname.Text
ds.Tables("Provider").NewRow.Item("Name") = providername
thisCurrencyManager.EndCurrentEdit()
DataGrid1.Refresh()
End Sub
Tracey
Remember... True happiness is not getting what you want...
Its wanting what you have got!