CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2002
    Posts
    9

    VB.net 64bit problem?

    I have just changed to a new 64bit computer so of course my oledb.4.0 calls dont work and I have replaced them with Ace.oledb.12.0 and that seems to work fine I can preview the data. However a simple program which worked fine befrore in 32bit keeps throwing an error

    A first chance exception of type 'System.InvalidOperationException' occurred in System.Data.dll

    The program is very simple
    in Design view I have a designgridview, ListBindingSource, listTableAdapter & my dataset.xsd
    I can rightclick the ListTableApapter and preview the data fine.

    My code is just

    Public Class List2
    Private Sub List2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me.ListTableAdapter.Fill(Me.STT_phonelistDataSet.List)
    End Sub
    End Class

    At design time I can preview the data in the DatagridView so all the data sources must be set ok. But when I run the program I get the error and the Grid is empty

    Any ideas why?
    Perhaps I should also mention thaqt I'm using 2010 express but the previous working version was in 2008 express

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: VB.net 64bit problem?

    The form isn't LOADED, so you can't FILL the grid. Use a different event.

    In Net you can use the Form PAINT event, which is where you draw to the screen.

    Don't fill the adapter every screen refresh. Use code to CHECK if it's nothing!

    Or add some Initialization() code.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Feb 2002
    Posts
    9

    Re: VB.net 64bit problem?

    I tried other events with no difference, and since this is my startup form it must load (certainly the code steps through)

    I think the problem is to do with the fact that I'm rumnning 64bit but my database is on a server running 32bit

    I found the following but dont understand where this setting is

    Since IIS is in control of the process bitness, the solution in my case was to set the Enable32bitAppOnWin64 setting to true: http://blogs.msdn.com/vijaysk/archiv...me-server.aspx

  4. #4
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: VB.net 64bit problem?

    What OS are you running now and before?

    You say you are running a 64 bit computer [pretty much all computers are 64 bit now] but you do not say what OS you are running or what you were running before.
    Always use [code][/code] tags when posting code.

  5. #5
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: VB.net 64bit problem?

    Are you using ASP.Net for a web app? I have a SQL2005 instance at my web host. My schedule program works by connecting to it. It is a windows forms app (DevExpress).

    Allows shared contacts and schedule, without needing Exchange Server
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  6. #6
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: VB.net 64bit problem?

    see if this can help:
    http://social.msdn.microsoft.com/For...b-acc8b0a5a091
    The setup for Visual Studio has to be changed to "x86" from "AnyCPU".
    Last edited by Cimperiali; May 17th, 2010 at 06:15 PM.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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

Featured