lunargirrl
Programmer
I have 10 checkboxes in my CheckBoxList, each one has values that go from 1 to 10.
I cant find what is wrong in this for each - next, that is inserting in my database always the lower value that I have in my checkboxlist.
Dim item As ListItem
Dim value As Integer
ActualDate = FormatDateTime(Now(), DateFormat.ShortDate)
For Each item In Me.chkList.Items
If item.Selected = True Then
value = Convert.ToInt32(chkList.SelectedItem.Value)
strSql = "INSERT INTO T_web_modulos_usuarios (COD_USER, COD_MODULE, COD_ACTION, DAT_CADASTRO, DAT_ATZ) " & _
"VALUES ('" & Me.txtCodUser.Text & "', '" & value & "', '" & value & _
"','" & DataAtual & "', '" & DataAtual & "')"
Try
objSC.InsertData(strsql2, enuTipoBanco.Web)
Catch err As Exception
Response.Write("Error!")
End Try
End If
Next
Someone could help,
thank you!!
I cant find what is wrong in this for each - next, that is inserting in my database always the lower value that I have in my checkboxlist.
Dim item As ListItem
Dim value As Integer
ActualDate = FormatDateTime(Now(), DateFormat.ShortDate)
For Each item In Me.chkList.Items
If item.Selected = True Then
value = Convert.ToInt32(chkList.SelectedItem.Value)
strSql = "INSERT INTO T_web_modulos_usuarios (COD_USER, COD_MODULE, COD_ACTION, DAT_CADASTRO, DAT_ATZ) " & _
"VALUES ('" & Me.txtCodUser.Text & "', '" & value & "', '" & value & _
"','" & DataAtual & "', '" & DataAtual & "')"
Try
objSC.InsertData(strsql2, enuTipoBanco.Web)
Catch err As Exception
Response.Write("Error!")
End Try
End If
Next
Someone could help,
thank you!!