Results 1 to 19 of 19

Thread: [2005] dumbfounded by datagridview problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2005
    Posts
    156

    [2005] dumbfounded by datagridview problem

    ok
    i have 2005 standard and currently working on vista ultimate. all .Net frameworks have been installed.

    I have an app that makes use of plain old regular datagridview. to make the story short, on a button click I start a background worker that collects data from various sources and updates the dataset that is bound to the DGV.
    once the background worker completes I run a refresh on the DGV to display results.

    anyway all of this works great when I am doing it within VS, however if i installed the very same app on the same computer and run it, the app crashes at the point where the number of rows added exceeds the visible area of the DGV. Meaning it crashes on the creation on the vertical scrollbar...

    Does ANYBODY have any idea how to get around this? I have done many other apps that behave exactly the same without any problems, but now all of a sudden i can't get them to work.

    thanx

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] dumbfounded by datagridview problem

    If it crashes then it's throwing an exception. The exception contains information regarding the issue. Use the exception to get the information, then post again.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2005
    Posts
    156

    Re: [2005] dumbfounded by datagridview problem

    i really wish it was that simple, but after putting 1000000000000 try and catch statements everywhere, I am coming back empty-handed.
    no error message is ever displayed.
    Please keep in mind that it works WITHOUT problems when running from inside VS. Once I compile and install on the same machine I have the problem... it makes no sense to me...

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] dumbfounded by datagridview problem

    Handle the application's UnhandledException event and see if it catches anything.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    Member
    Join Date
    Sep 2005
    Location
    West Chester, PA
    Posts
    42

    Re: [2005] dumbfounded by datagridview problem

    I had a DGV issue a short while ago where the grid was disappearing after a refresh (there wasn't a crash or anything, just a missing grid). The problem I had was that the bookmarks was set to a value beyond the number of existing rows, so no row was visible. Probably not related to your issue, but you could double check the bookmarks value (this was a VB6 app, though).

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Aug 2005
    Posts
    156

    Re: [2005] dumbfounded by datagridview problem

    Quote Originally Posted by jmcilhinney
    Handle the application's UnhandledException event and see if it catches anything.
    stupid q: how exactly do i do that

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Aug 2005
    Posts
    156

    Re: [2005] dumbfounded by datagridview problem

    ok ignore previous post. I figured out how to do it and this is what Vista records:
    Product
    Barcode Reporter

    Problem
    Stopped responding and was closed

    Date
    5/31/2007 8:36 AM

    Status
    Not Reported

    Description
    A problem caused this program to stop interacting with Windows.

    Problem signature
    Problem Event Name: AppHangB1
    Application Name: Barcode Reporter.exe
    Application Version: 1.0.0.0
    Application Timestamp: 465e14f2
    Hang Signature: 7eca
    Hang Type: 260
    OS Version: 6.0.6000.2.0.0.256.1
    Locale ID: 1033
    Additional Hang Signature 1: 3672ee76f554ae20f728a40f6b7dc5e0
    Additional Hang Signature 2: 0912
    Additional Hang Signature 3: c7a92653dd88a40009ad816e70d9697a
    Additional Hang Signature 4: 5a5b
    Additional Hang Signature 5: 6457dcf7ad9f2106875ceffb770071c5
    Additional Hang Signature 6: 328c
    Additional Hang Signature 7: 2cdab6f97118db44ae1cdc6cf14c81cf

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Aug 2005
    Posts
    156

    Re: [2005] dumbfounded by datagridview problem

    well i have found a workaround for my problem but no real solution. the bottom line is that when i try to update the DGV from a background worker thread it crashes the app if it is run outside the VS environment.
    I have no idea why this is or if this is a DGV bug, but i simply created a separate dataset that is bound to the grid and once the background worker completes compiling data and storing inside a secondary dataset, i simply copy the data and then update the grid. seems to work.

    if any more ideas arise please let me know, because I see this as piss-poor coding

    thanx

  9. #9
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] dumbfounded by datagridview problem

    Are you accessing any members of the DataGridView directly from the DoWork event handler of the BackgroundWorker or from any method called from the DoWork event handler? If so then that is probably your issue. The DoWork event handler is executed in a worker thread and you should never access controls directly from a worker thread. You should either use a delegate or you can call the ReportProgress method of the BackgroundWorker and access the control(s) from the ProgressChanged event handler, which is executed in the UI thread. If you're already doing one of those things then I have no idea what the issue might be.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Aug 2005
    Posts
    156

    Re: [2005] dumbfounded by datagridview problem

    unfortunately I am all too familiar with cross-threading issues, yet lucky enough that I learned long time ago how to use delegates and such.
    Hence, YES I am using delegates to actually update the grid/dataset bound to grid, but it makes no difference...

  11. #11
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] dumbfounded by datagridview problem

    The only thing left to suggest is that you post the relevant code, which shouldn't take a request in post #11 to do. You should be posting relevant code in the very first post.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  12. #12
    Banned
    Join Date
    May 2007
    Location
    Atlanta, Georgia, United States
    Posts
    21

    Re: [2005] dumbfounded by datagridview problem

    Quote Originally Posted by morpheus3230
    stupid q: how exactly do i do that
    Very easily, my friend! Use a try...catch.

    Code:
    Try
    'Load database data
    Catch ex as Exception
    MsgBox(ex.message)
    End Try

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Aug 2005
    Posts
    156

    Re: [2005] dumbfounded by datagridview problem

    i understand but the code is too long too post, plus I have described the issue thoroughly. there really is nothing else in the code that would point to anything because everything works great in the IDE, but not as standalone. What the difference is, is beyond me...

  14. #14
    Banned
    Join Date
    May 2007
    Location
    Atlanta, Georgia, United States
    Posts
    21

    Re: [2005] dumbfounded by datagridview problem

    Quote Originally Posted by morpheus3230
    i understand but the code is too long too post, plus I have described the issue thoroughly. there really is nothing else in the code that would point to anything because everything works great in the IDE, but not as standalone. What the difference is, is beyond me...
    Morpheus, did you try the script I just posted?

  15. #15

    Thread Starter
    Addicted Member
    Join Date
    Aug 2005
    Posts
    156

    Re: [2005] dumbfounded by datagridview problem

    yes, there is plenty of try and catch statements in the code and I have even done what jmcilhinney has suggested in regard to unhandled exceptions.
    again please keep in mind that the app is WORKING GREAT in VS. however when i install it as a standalone app on the same PC, the app crashes when the number of rows exceeds the visible area of the grid. The vertical bar does not show up and the app freezes...
    Inside of VS, none of this happens and the app completes it's job without any difficulties...

    Can anybody please try to recreate this? It would be very simple. I can even do it and post the code. I just need to know if this is my issue or a real datagridview bug. I have tried it on 2 PC's (vista and xp prop sp2) and the results are the same.

  16. #16
    Banned
    Join Date
    May 2007
    Location
    Atlanta, Georgia, United States
    Posts
    21

    Re: [2005] dumbfounded by datagridview problem

    Quote Originally Posted by morpheus3230
    yes, there is plenty of try and catch statements in the code and I have even done what jmcilhinney has suggested in regard to unhandled exceptions.
    again please keep in mind that the app is WORKING GREAT in VS. however when i install it as a standalone app on the same PC, the app crashes when the number of rows exceeds the visible area of the grid. The vertical bar does not show up and the app freezes...
    Inside of VS, none of this happens and the app completes it's job without any difficulties...

    Can anybody please try to recreate this? It would be very simple. I can even do it and post the code. I just need to know if this is my issue or a real datagridview bug. I have tried it on 2 PC's (vista and xp prop sp2) and the results are the same.
    Does the PC you distributed it on have the same .NET version as you development PC?

  17. #17

    Thread Starter
    Addicted Member
    Join Date
    Aug 2005
    Posts
    156

    Re: [2005] dumbfounded by datagridview problem

    as mentioned multiple times... it IS the same PC!

  18. #18
    Banned
    Join Date
    May 2007
    Location
    Atlanta, Georgia, United States
    Posts
    21

    Re: [2005] dumbfounded by datagridview problem

    So you have built the final solution? Are you using the executable from the Debug or Release folder?

  19. #19

    Thread Starter
    Addicted Member
    Join Date
    Aug 2005
    Posts
    156

    Re: [2005] dumbfounded by datagridview problem

    debug. have done it million times with other apps without problems

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width