Can't run samples

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
CNPSV
Posts: 27
Joined: Thu 01 Nov 2007 09:48

Can't run samples

Post by CNPSV » Thu 01 Nov 2007 09:55

Hello. I have installed the latest version of PostgreSQLDirect .NET for Visual Studio 2005. I want to run the CRM sample, so I've created a database in pgAdmin III, called "crm_demo". After that I ran the crm_demo.sql. When I run the sample in C# 2005, I've pressed the Connect button, I've entered the correct information, and after that I've received:

System.InvalidCastException was unhandled by user code
Message="Unable to cast object of type 'PersonContactDataTable' to type 'System.Collections.IList'."
Source="CrmDemo"
StackTrace:
at CrmDemo.MainForm.content_ListChanged(Object sender, ListChangedEventArgs e) in C:\Program Files (x86)\CoreLab\PostgreSQLDirect.NET2\Samples\CRM\CS\MainForm.cs:line 97
at System.ComponentModel.ListChangedEventHandler.Invoke(Object sender, ListChangedEventArgs e)
at CoreLab.Common.j.b(Object A_0, ListChangedEventArgs A_1)

Can anyone tell me how to run those samples correctly?

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Thu 01 Nov 2007 15:47

Where do you enter information?
Please post the full stack trace of the exception.

CNPSV
Posts: 27
Joined: Thu 01 Nov 2007 09:48

Solved

Post by CNPSV » Fri 02 Nov 2007 08:16

I've had this problem because I was running the Visual Studio Compiler for x64 (default for Vista). After setting the compiler for x86 it works. I still cat an error at the first load, but after that, it works.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Re: Solved

Post by Alexey » Fri 02 Nov 2007 09:52

CNPSV wrote:I still cat an error at the first load, but after that, it works.
What error?

CNPSV
Posts: 27
Joined: Thu 01 Nov 2007 09:48

The Error

Post by CNPSV » Fri 02 Nov 2007 09:59

Unable to cast object of type 'CompanyDataTable' to type 'System.Collections.IList'.

" at CrmDemo.MainForm.content_ListChanged(Object sender, ListChangedEventArgs e) in C:\Program Files (x86)\CoreLab\PostgreSQLDirect.NET2\Samples\CRM\CS\MainForm.cs:line 97\r\n at System.ComponentModel.ListChangedEventHandler.Invoke(Object sender, ListChangedEventArgs e)\r\n at CoreLab.Common.j.b(Object A_0, ListChangedEventArgs A_1)"

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 02 Nov 2007 10:50

OK, we will try to reproduce this error.

Post Reply