tags:

views:

262

answers:

2

I specify the dataprovider in a subsonic Select as in the following example:

SubSonic.Select(Databases.BLLDB).From(Of Country)().ExecuteTypedList(Of Country)()

yet I get the error: Invalid column name 'BLLDB'

(it seems to be treating the dataprovider as a column string).

Is this the correct syntax for specifying the dataprovider?

Thanks

+1  A: 

This would work better but there are easier ways to do the same thing:

[Test]
public void Exec_SOTest()
{

    var test = new Select(DataService.GetInstance(Databases.Northwind))
        .From("Products")
        .ExecuteTypedList<Product>();

    Assert.IsTrue(test.Count == 77);
}
P a u l
A: 

Strings are for columns with selects, unfortunately. We should have a struct that returns a provider - but if you use the Repository bits you can work ask for the select statement from the repository you need.

Other than that - Paul's got a good idea here.

Rob Conery