I need the date to go to my dataTable

5 pts.
Tags:
SQL Database
VB 2012
I have a form that updates the amounts a parent is either charging or paying which is working but I need the date to go to my parent table also for the date of a payment or a separate column if it was a charge. I would put my code on here but I dont see a place for it.
 Private Sub ButtonUpdateBalance_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonUpdateBalance.Click
        Dim DB_DaycareDataSet As New DataSet
        Dim NewBalance As Decimal
        If RadioButtonPayment.Checked Then
                NewBalance = OldBalance - CDbl(TextBoxAmountDue.Text)
            
        Else
            NewBalance = OldBalance + CDbl(TextBoxAmountDue.Text)

        End If

        Dim UpdateParentStatement As String = "UPDATE Parent " & _
                                                "Set Balance = " & NewBalance & " " & _
                                                "Where ParentId = '" & OldNum & "'"

        Dim ParentDataAdapter As New SqlDataAdapter(UpdateParentStatement, connection)
        ParentDataAdapter.Fill(DB_DaycareDataSet, "Parent")
        TextBoxAmountDue.Text = FormatCurrency(CDbl(TextBoxAmountDue.Text))
        TextBoxNewBalance.Text = FormatCurrency(NewBalance)
        LabelNewBalance.Visible = True
        TextBoxNewBalance.Visible = True
        MessageLabel.Visible = True


    End Sub

    'Private Sub MaskedTextBox1_MaskInputRejected(ByVal sender As System.Object, ByVal e As System.EventArgs)
    '    Dim DB_DaycareDataSet As New DataSet
    '    Dim LastPaymentDate As Integer

    '    Dim SelectParentStatement As String = ListBoxParents.SelectedItem = "UPDATE Parent" & _
    '                                                                        "Set LastPaymentDate = " & _
    '                                                                        "Where ParentId = '" & LastPaymentDate & "'"
    '    If RadioButtonCharge.Checked Then
    '        MaskedTextBoxDate.Text = "Parent.InvoiceDate "
    '    Else
    '        MaskedTextBoxDate.Text = "Parent.LastPaymentDate"
    '    End If


    'End Sub

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following