Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 194841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:37:47+00:00 2026-05-11T16:37:47+00:00

I am working with an old web application developed in VB.NET 1.1 framework. I

  • 0

I am working with an old web application developed in VB.NET 1.1 framework. I am having an issue with checkboxes.

I have the following code for my checkbox:

<asp:TemplateColumn HeaderText="Reviewed">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<ItemTemplate>
<asp:checkbox ID="chkAppRev" Runat="server" 
    OnCheckedChanged="onCheckChange" AutoPostBack="True" />  
</ItemTemplate>
</asp:TemplateColumn>

and this for my OnCheckChanged event:

Public Sub onCheckChange(ByVal sender As Object, ByVal e As EventArgs)
    Dim strSQL As String = String.Empty
    Dim inbox As CheckBox = CType(sender, CheckBox)
    Dim dgItem As DataGridItem = CType(inbox.NamingContainer, DataGridItem)
    Dim conn As OleDb.OleDbConnection = New OleDb.OleDbConnection(ConfigurationSettings.AppSettings("CONNECTIONSTRING"))
    Try
        '--update checkbox field on record in database
        conn.Open()
        If inbox.Checked = True Then
            strSQL = "Update AppUserJobs Set AppChecked=1 " & _
            "Where AppUserId=" & Convert.ToInt32(dgItem.Cells(9).Text) & 
 " and JobId=" & Convert.ToInt32(dgItem.Cells(10).Text)



        Else
            strSQL = "Update AppUser Set AppChecked=0 " & _
            "Where AppUserId=" & Convert.ToInt32(dgItem.Cells(9).Text) & 
" and JobId=" & Convert.ToInt32(dgItem.Cells(10).Text)
        End If

        Dim cmd As OleDb.OleDbCommand = New OleDb.OleDbCommand(strSQL, conn)
        Dim intRec As Integer = cmd.ExecuteNonQuery()
        conn.Close()
    Catch ex As Exception
    Finally
        If (conn.State = ConnectionState.Open) Then
            conn.Close()
        End If
    End Try
    BindData()
End Sub

This all works fine until I add another check box in the asp code and another oncheckchanged method, it seems like it just skips over the query.

Does anyone have any ideas what I missed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:37:47+00:00Added an answer on May 11, 2026 at 4:37 pm

    You have a BIG NO-NO in the code: it is silently cathing an exception and throwing it away.

    There is some kind of exception somewhere in the method, but as you throw away all information about it, there is no hint to what it is that goes wrong. It’s probably some of the references that is null, but without any information that tells you which one, it’s hard to spot the problem.

    Remove this line so that the exception is not silently buried:

    Catch ex As Exception
    

    Alternatively put some code after it that actually handles the exception. In that case you should change the line so that you don’t catch the base class Exception but some more specific exception class like SqlException.

    With some information about where the exception occurs, it’s possible to spot the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just been re-working an old bit of compiler-like code written using bison.
I'm working with some old PHP code that has a lot of the following:
I am currently working on a web application where I have encountered a little
net webforms application which is a new version of an old webshop. I have
Have you ever seen someone try to implement the MVP pattern with ASP.NET Web
Working on an old site in asp classic. I want to write a function
I'm working on bringing some old code from 1998 up to the 21st century.
Very odd problem as this is working perfectly on our old Classic ASP site.
Background: I am an intermediate web app developer working on the .Net Platform. Most
I recently uploaded my ASP.NET MVC 2 Preview 2/.NET 4 application (Built using VS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.