Adding code to the console application Problem

Posts   
 
    
lss
User
Posts: 25
Joined: 23-Dec-2008
# Posted on: 29-Dec-2008 23:32:57   

After I setup the using/Imports statatements at the top of Program.cs file, at the Using Entity part, I was using the same code as stated in the tutorial:

// C#               
// setup filter. 
RelationPredicateBucket filter = new RelationPredicateBucket(CustomerFields.Country == "USA");
[colorvalue="FF0000"]EntityCollection<CustomerEntity> customers = new EntityCollection<CustomerEntity>();[/color] //**caused error
// fetch them using a DataAccessAdapter instance
using(DataAccessAdapter adapter = new DataAccessAdapter())
{
    adapter.FetchEntityCollection(customers, filter);
}

Console.WriteLine("Number of entities fetched: {0}", customers.Count);
// Display for each customer fetched the CustomerId and the CompanyName.
foreach(CustomerEntity c in customers)
{
    Console.WriteLine("{0} {1}", c.CustomerId, c.CompanyName);
}

I kep getting eror : error CS0308: The non-generic type 'Northwind.HelperClasses.EntityCollection' cannot be used with type arguments

I have using System.Collections.Generic; in my code

How can I fix this error? Thanks, lss

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 30-Dec-2008 02:18:38   

Hi Iss,

This is typically a wrong referenced version of the LLBLGen Pro dlls, in your generated projects. This happen if you have multiple LLBLGen versions in your box and you referenced a wrong version of the dlls.

Please remove them (SD.LLBLGen.ORMSupportClasses) and re-add them again. If i'm not mistaken, you are using LLBLGen 1.0.2005.1. So, maybe you installed LLBLGen 2.x. Please make sure you referenced the correct version wink

David Elizondo | LLBLGen Support Team
lss
User
Posts: 25
Joined: 23-Dec-2008
# Posted on: 30-Dec-2008 17:34:43   

I believe I only have LLBLGen 1.0.2005.1 installed on my computer. I'm using VS2005 Express Edition, .NET Framework Version 2.0.50727. So I used LLBLGen Pro .NET 2.0 ORM Support Classes Library Version 1.0.2005.1 as a reference.

Please let me know if I'm missing something or what I should do to make it work. thanks lss

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 30-Dec-2008 21:34:15   

Is the sample console application that you are using taken from version 1 of LLBLGen as well ?

Or have you generated code for SelfServicing when the sample app is expecting Adapter (or vice-versa)...? Matt

lss
User
Posts: 25
Joined: 23-Dec-2008
# Posted on: 31-Dec-2008 16:54:38   

Thanks for your help.. I'm finally able to finish the project. This example was very helpful for me : http://www.screencast.com/users/quantum00/folders/Default/media/4e5769af-678a-4087-a346-971fabcac6bf

thanks lss