Click to See Complete Forum and Search --> : VB.net 64bit problem?


davep
May 13th, 2010, 10:53 AM
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

dglienna
May 13th, 2010, 12:18 PM
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.

davep
May 14th, 2010, 02:50 AM
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/archive/2009/03/06/iis-7-tip-2-you-can-now-run-32-bit-and-64-bit-applications-on-the-same-server.aspx

DataMiser
May 14th, 2010, 08:25 AM
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.

dglienna
May 15th, 2010, 10:20 AM
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

Cimperiali
May 16th, 2010, 02:53 PM
see if this can help:
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/22a7474c-b54d-4be0-928b-acc8b0a5a091

The setup for Visual Studio has to be changed to "x86" from "AnyCPU".