Can't run samples

Can't run samples

Postby 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?
CNPSV
 
Posts: 27
Joined: Thu 01 Nov 2007 09:48

Postby Alexey » Thu 01 Nov 2007 15:47

Where do you enter information?
Please post the full stack trace of the exception.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Solved

Postby 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.
CNPSV
 
Posts: 27
Joined: Thu 01 Nov 2007 09:48

Re: Solved

Postby 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?
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

The Error

Postby 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)"
CNPSV
 
Posts: 27
Joined: Thu 01 Nov 2007 09:48

Postby Alexey » Fri 02 Nov 2007 10:50

OK, we will try to reproduce this error.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for PostgreSQL