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 3492108
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:43:07+00:00 2026-05-18T11:43:07+00:00

I call a function (SaveChanges) to access my business / data layer and save

  • 0

I call a function (SaveChanges) to access my business / data layer and save any changes to fields that are marked as an Add or Update and are marked to be processed. This function used to work fine up until 60+ minutes ago.

What is happening is that suddenly the function is returning false. After debugging through the code, when it hits Return the local boolean is set as True … but when it gets back to the calling method (and uses the return value) it is now False.

As I said I went through line by line and debugged it, then I added a watch to it. The funny part is that there is one spot that sets the boolean to false, and when I put a breakpoint on that spot it is never reached.

Here is the function:

Private Function SaveChanges() As Boolean

    Dim blnSaved As Boolean = True

    Dim saveableRows As List(Of DataRow) = (From d As DataRow In _listData.Tables(0).Rows _
                                            Where Not d("Marking") = "Duplicate" _
                                            And d("Process") = True _
                                            Select d).ToList()


    If saveableRows.Count > 0 Then

        For Each drRow As DataRow In saveableRows

            Dim data As IDataEntity = DataEntities.GetData(_tableName)

            If drRow("Marking") = "Update" Then

                'UPDATE
                data.UpdateItem(drRow.ItemArray)

            Else

                'ADD
                data.AddItem(drRow.ItemArray)

            End If

            If data.HasErrors Then

                blnSaved = False 'Never reaches this part ... !?!?!

            End If

        Next

    Else

        blnSaved = True

    End If

End Function

And here is how I’m using the function:

If SaveChanges() Then

        Dim frmTableView As frmTableView = New frmTableView(_listData.Tables(0).TableName)

        If Not Me.MdiParent Is Nothing Then

            frmTableView.MdiParent = Me.MdiParent

        End If

        frmTableView.Show()

        Me.Close()

    Else

        MessageBox.Show("Unable to save the list. IT has been notified.", "Save Failed", MessageBoxButtons.OK, MessageBoxIcon.Error)

    End If

I’m spending too much time on this and figured it was time to look for help.

Thanks

  • 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-18T11:43:07+00:00Added an answer on May 18, 2026 at 11:43 am

    You’re never returning your boolean. Add:

    Return blnSaved
    

    at the bottom of the function.

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

Sidebar

Related Questions

There is a socket related function call in my code, that function is from
How do I call a function, using a string with the function's name? For
I want to call a function from a .NET DLL (coded in C#) from
When I call this function, everything works, as long as I don't try to
Can I call a function from lisp from a library written in c or
I cant call protected function in my base class. Why? It looks something like
I want to call a function (which calculates my version number) when my NSIS
I'm trying to call a function after I load some XML into Actionscript, and
I'd like to call a function in python using a dictionary with matching key-value
case i of 0..99 : Function-call('bobo') ; 100..209 : function-smell('Hobo'); 210..300 : function-yikes('argh'); end;

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.