beantownace
Active member
- Joined
- Feb 15, 2019
- Messages
- 42
- Programming Experience
- 5-10
Hello all,
I am trying to see what is the best way to handle this in a proficient manner. I have a SQLDataReader that is returning a flattened result set where I am trying to group the data and add to a List property a few of the fields in the result set. I found a forum post using IDataReader with SelectRows with Group but I am not seeing SelectRows as an option.
The result set I get to avoid multiple query calls is a flattened reader return of data example query return:
Customer1, Maryland, Active, 123, 55.55
Customer1, Maryland, Active, 456, 77.89
Customer1, Maryland, Inactive, 789, 99.43
Customer2, Seattle, Active, 321, 77.77
Here is what I have below for the classes and I am trying to group the results by name, location, status then add to the list of invoices for that customer using the GetString etc.
Thanks all for any help if you have an example how I can do this.
I am trying to see what is the best way to handle this in a proficient manner. I have a SQLDataReader that is returning a flattened result set where I am trying to group the data and add to a List property a few of the fields in the result set. I found a forum post using IDataReader with SelectRows with Group but I am not seeing SelectRows as an option.
The result set I get to avoid multiple query calls is a flattened reader return of data example query return:
Customer1, Maryland, Active, 123, 55.55
Customer1, Maryland, Active, 456, 77.89
Customer1, Maryland, Inactive, 789, 99.43
Customer2, Seattle, Active, 321, 77.77
Here is what I have below for the classes and I am trying to group the results by name, location, status then add to the list of invoices for that customer using the GetString etc.
Customer Class and Invoice Class:
public class Customer
{
public string name { get; set; }
public string location { get; set; }
public string status { get; set; }
public List<Invoice> { get; set; }
}
public class Invoice
{
public string invoiceNumber { get; set; }
public decimal? amount { get; set; }
}
Thanks all for any help if you have an example how I can do this.