Select multiple records

Sep 29, 2010 at 1:52 PM

I am running the code below where I want to query all the records given a collection of Primary Key Values that is of type Guid. But for some reason Select does not return any records back. It works fine if I query for any column that is type string.

string selectQuery = "select * from Customer where CustomerId in (@CustomerId)";
parameter = new CommandParameter("CustomerId", null); 

parameter.Values.Add(Guid1);

parameter.Values.Add(Guid2);

List<Customer> customers = savant.Select<Customer>(selectQuery, parameter);

Any thoughts what I might be doing wrong?

Thanks

Amber

Coordinator
Sep 29, 2010 at 2:09 PM

This is not a Savant issue. Your query does not follow SimpleDB conventions for referencing the id. It should be:



string
selectQuery = "select * from Customer where itemName() in (@CustomerId)";

 

 

Sep 30, 2010 at 1:52 AM

Thanks a lot. This worked.