Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. extremely strange ado.net issue

extremely strange ado.net issue

Scheduled Pinned Locked Moved Database
databasehelpcsharpasp-netquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    ekynox
    wrote on last edited by
    #1

    G'day folks, I have been experiencing an extremely strange problem in my code, this has to be marked as a X-File episode. I have a method in my class which executes two other methods. One method(Method A) inserts a row in table A and the other (Method B) inserts a row in table B. This is part of an asp.net application. When I run the the asp.net application without debugging both methods (A and B) execute fine, however method B doesnt seem to be updating table B whereas Method A updates Table A just fine. I ran my query through MS Access with test data and the table got updated. Then I decided to step through the code and again method B seems to be updating table B. I run the application again without debugging and samething happens Table B doesnt get updated and Table A is getting updated. For the life of me I cant seem to point my finger where the problem is residing. Can this be a connectivity issue with MS Access and my asp.net application ? Both the asp.net and access database are residing in my development environment. Any pointers will be appreciated. thanks

    C 1 Reply Last reply
    0
    • E ekynox

      G'day folks, I have been experiencing an extremely strange problem in my code, this has to be marked as a X-File episode. I have a method in my class which executes two other methods. One method(Method A) inserts a row in table A and the other (Method B) inserts a row in table B. This is part of an asp.net application. When I run the the asp.net application without debugging both methods (A and B) execute fine, however method B doesnt seem to be updating table B whereas Method A updates Table A just fine. I ran my query through MS Access with test data and the table got updated. Then I decided to step through the code and again method B seems to be updating table B. I run the application again without debugging and samething happens Table B doesnt get updated and Table A is getting updated. For the life of me I cant seem to point my finger where the problem is residing. Can this be a connectivity issue with MS Access and my asp.net application ? Both the asp.net and access database are residing in my development environment. Any pointers will be appreciated. thanks

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      ekynox wrote:

      Any pointers will be appreciated.

      Here ya go![^] Seriously, you might want to also put in some tracing code so that you can see exactly what is being sent to the database (or if the method is being called) Or perhaps there is something obvious in the method itself that is different from the other method.


      Upcoming FREE developer events: * Developer! Developer! Developer! 6 * Developer Day Scotland My website

      E 1 Reply Last reply
      0
      • C Colin Angus Mackay

        ekynox wrote:

        Any pointers will be appreciated.

        Here ya go![^] Seriously, you might want to also put in some tracing code so that you can see exactly what is being sent to the database (or if the method is being called) Or perhaps there is something obvious in the method itself that is different from the other method.


        Upcoming FREE developer events: * Developer! Developer! Developer! 6 * Developer Day Scotland My website

        E Offline
        E Offline
        ekynox
        wrote on last edited by
        #3

        LOL Colin that's one funny pointer. I managed to work out my problem, it was do with timing issue. By the time MethodA finishes executing, I believe access has not had time to update Table A, then MethodB starts executing and Table A is missing the relavant data and MethodB fails to insert a row in Table B. Why does it work in debug mode well when debugging there is ample time for Access to actually commit the data into the table. Solution was to a a Thread.Sleep() to cause pause and it all works. Yes you are right about placing tracing code. public void AddStuffToDB() { MethodA(string x,string y); MethodB(string x); }

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups