tags:

views:

19

answers:

0

I am trying to query a VIEW using Subsonic (2.5). The coding works, but Subsonic ONLY returns data if the result has more than 1 row. E,g, is the query produces 2 records the datatable returned will have 2 records. If the query produces 1 row, that datatable will have 0 records in it?! I've checked the view, and the problem is not there.

This is desperately urgent, has anyone got any ideas? Thanks!

Code: **Int32 _ordernumber = (Int32)_item.GetDataKeyValue("ordernumber").ToString();

                Query _qry = new Query(Views.ViewOrderDelivery).WHERE("OrderNumber",Comparison.Equals ,_ordernumber);

ViewOrderDeliveryCollection _deliver = new ViewOrderDeliveryCollection() ;

_deliver.LoadAndCloseReader(_qry.ExecuteReader());

e.DetailTableView.DataSource = _deliver;**