Page 1 of 1

Can't run samples

Posted: Thu 01 Nov 2007 09:55
by CNPSV
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?

Posted: Thu 01 Nov 2007 15:47
by Alexey
Where do you enter information?
Please post the full stack trace of the exception.

Solved

Posted: Fri 02 Nov 2007 08:16
by CNPSV
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.

Re: Solved

Posted: Fri 02 Nov 2007 09:52
by Alexey
CNPSV wrote:I still cat an error at the first load, but after that, it works.
What error?

The Error

Posted: Fri 02 Nov 2007 09:59
by CNPSV
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)"

Posted: Fri 02 Nov 2007 10:50
by Alexey
OK, we will try to reproduce this error.