locked
call function from function RRS feed

  • Question

  • User1131170801 posted

    Environment : VS2005 SP1

     Protected Sub BILL_AMTTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
            Dim adapter As SqlDataAdapter
            Dim ds As New DataSet
    
            Dim prev_amt As Double
            Dim _tds As Double
            Dim _billamt As TextBox = FormView1.FindControl("BILL_AMTTextBox")
            Dim connectionstring As String = ConfigurationManager.ConnectionStrings("accountsConnectionString").ConnectionString
            Dim connection As New SqlConnection(connectionstring)
    
            Try
                connection.Open()
                adapter = New SqlDataAdapter("select sum(BILL_AMT) as SUM_AMT,sum(TDS) as PTDS  from FIRMDT where Code = " + DropDownList1.SelectedValue, connection)
    
                adapter.Fill(ds)
                connection.Close()
                If ds.Tables.Count > 0 Then
    
                    Dim chkcb As CheckBox = FormView1.FindControl("chktax")
                    If chkcb.Checked = True Then
                        'If Not IsDBNull(ds.Tables(0).Rows(0).Item(0)) Then
                        txttotal.Text = IIf((ds.Tables(0).Rows(0).Item("SUM_AMT")) Is DBNull.Value, 0, (ds.Tables(0).Rows(0).Item("SUM_AMT"))) + Val(_billamt.Text)
                        txttds.Text = System.Math.Round(txttotal.Text * 0.02) - IIf((ds.Tables(0).Rows(0).Item("PTDS")) Is DBNull.Value, 0, (ds.Tables(0).Rows(0).Item(1)))
    
                        Dim control As TextBox = FormView1.FindControl("tdstextbox")
                        control.Text = System.Math.Round(txttotal.Text * 0.02) - IIf((ds.Tables(0).Rows(0).Item("PTDS")) Is DBNull.Value, 0, (ds.Tables(0).Rows(0).Item(1)))
                    Else
                        Dim control As TextBox = FormView1.FindControl("tdstextbox")
                        control.Text = 0
    
                    End If
                End If
                ' Dim f_name As String
                'Dim DR As SqlDataReader
                'Dim cm As SqlCommand
                'cm = New SqlCommand("select sum(BILL_AMT) as SUM_AMT,sum(TDS) as PTDS  from FIRMDT where Code = " + DropDownList1.DataValueField )
                'DR = cm.ExecuteReader
                'DR.Read()
                'txttotal.Text = DR(0)
                'DR.Close()
    
            Catch
    
            End Try
        End Sub
    
        Protected Sub CHKTX_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
            Dim chkcb As CheckBox = FormView1.FindControl("chktax")
            Dim control As TextBox = FormView1.FindControl("flagtextbox")
            If chkcb.Checked = True Then
                control.Text = "Y"
            Else
                control.Text = "N"
            End If
            Call Me.BILL_AMTTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        End Sub
     
    I want to do something like as it is bold part in code. This is giving error.. Please guide me how can I. 
     
    Thanks 

     

    Thursday, May 26, 2011 4:15 PM

Answers

  • User-1360095595 posted

    Does it work like this: Call Me.BILL_AMTTextBox_TextChanged(sender, e)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 26, 2011 4:19 PM

All replies

  • User-1360095595 posted

    Does it work like this: Call Me.BILL_AMTTextBox_TextChanged(sender, e)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 26, 2011 4:19 PM
  • User1131170801 posted

    thank you sir

     

    Thursday, May 26, 2011 11:32 PM