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

Ask A Question

Stats

  • Questions 112k
  • Answers 112k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Set a table width: <table width="50%"> ... </table> Width is… May 11, 2026 at 9:56 pm
  • Editorial Team
    Editorial Team added an answer use HTML text and you'll need to generate it yourself… May 11, 2026 at 9:56 pm
  • Editorial Team
    Editorial Team added an answer Did the source files that contain CommandBehavior get copied into… May 11, 2026 at 9:56 pm

Related Questions

I am currently doing some work for a company that runs a legacy web
I am having problems using the Visual Studio 2008 Javascript debugger. I can’t set
I have a site that I am currently working on in ASP.NET 2.0 using
I have been doing some performance analysis on an application I am working on.
I am trying to build a Google Maps-driven web application that can display a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.