worldatlas
MIS
I have the following code that is suppose to insert the following data when the user checked the checkbox in one of the column of the datagrid. However, I can't seem to get pass the
'If (Checkselector.Value = False And Checkselector.Checked) Then '
Is there a better way to verify if the checkbox is checked??
Any suggestion is greatly appreciated. Thank you
Private Sub Confirm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Confirm.Click
Dim dgItem As DataGridItem
Dim Checkselector As System.Web.UI.HtmlControls.HtmlInputCheckBox
For Each dgItem In dgActivity.Items
If (Checkselector.Value = False And Checkselector.Checked) Then
Dim transConn1 As SqlConnection
Dim transAdapt As SqlDataAdapter
transConn1 = New SqlConnection("data source=servername" & _
";persist security info=False;initial catalog=BUD")
transConn1.Open()
Dim insrtstring As String = "insert into CorrectionData (CreditAcctUnit, CreditAcct, CreditActivity, CreditCategory, Credit_Ind, CreditAmt, CreditUnit, CreditDescription, CreditReference, DebitAcctUnit, DebitAcct, DebitActivity, DebitCategory, Debit_Ind, DebitAmt, DebitUnit, DebitDescription, DebitReference, TransferUserID, PostingDate, Year, Period, InvoiceDate, TransType) values ('12001', '5003', '03010598', '1617', 'C', 12.50, 2, 'Payroll', '097653','12001', '5003', '03010598', '1617', 'C', 12.50, 2, 'Payroll', '097653','dhh', 8/15/2005, 2005, 8, 8/15/2005, 'RT')"
Dim transComm As New SqlCommand(insrtstring, transConn1)
transComm.ExecuteNonQuery()
transConn1.Close()
End If
Next
End Sub
'If (Checkselector.Value = False And Checkselector.Checked) Then '
Is there a better way to verify if the checkbox is checked??
Any suggestion is greatly appreciated. Thank you
Private Sub Confirm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Confirm.Click
Dim dgItem As DataGridItem
Dim Checkselector As System.Web.UI.HtmlControls.HtmlInputCheckBox
For Each dgItem In dgActivity.Items
If (Checkselector.Value = False And Checkselector.Checked) Then
Dim transConn1 As SqlConnection
Dim transAdapt As SqlDataAdapter
transConn1 = New SqlConnection("data source=servername" & _
";persist security info=False;initial catalog=BUD")
transConn1.Open()
Dim insrtstring As String = "insert into CorrectionData (CreditAcctUnit, CreditAcct, CreditActivity, CreditCategory, Credit_Ind, CreditAmt, CreditUnit, CreditDescription, CreditReference, DebitAcctUnit, DebitAcct, DebitActivity, DebitCategory, Debit_Ind, DebitAmt, DebitUnit, DebitDescription, DebitReference, TransferUserID, PostingDate, Year, Period, InvoiceDate, TransType) values ('12001', '5003', '03010598', '1617', 'C', 12.50, 2, 'Payroll', '097653','12001', '5003', '03010598', '1617', 'C', 12.50, 2, 'Payroll', '097653','dhh', 8/15/2005, 2005, 8, 8/15/2005, 'RT')"
Dim transComm As New SqlCommand(insrtstring, transConn1)
transComm.ExecuteNonQuery()
transConn1.Close()
End If
Next
End Sub