views:

252

answers:

2

Hi...I have some old code that was using Subsonic 1.x and want to migrate to 3. Some of my old methods used to return a Dataset using the old Subsonic Query object and then just calling ExecuteDataset().

I still need to support those methods, since they're called by other code...however, I can't find anywhere how to to a code query with Subsonic that will let me return a Dataset. Or is that completely gone??

Can anyone help? Thank you!

A: 

I have not used this in SubSonic 3.0, but the SubSonic.DataProviders.DbDataProvider object has an ExecuteDataSet method that takes a QueryCommand object. That might be what you need.

djuth
A: 

You can return execute a Reader and then Load the data from the reader to the datatable, something like this:

    SubSonic.Query.SqlQuery qry= new Select().From<Evento>().Where(EventosTable.FechaInicioColumn).IsEqual(3);
    System.Data.IDataReader reader = qry.ExecuteReader();
    System.Data.DataTable table = new System.Data.DataTable();
    table.Load(reader);
Isaias