I have two Asp.net ListView Controls bound to two different ObjectDataScource Controls. Each ODS control references 'MethodA' and 'MethodB'.
I want 'MethodA' to make one call the the database and return data for both 'MethodA' and 'MethodB'.
I could always have 'MethodB' make a second call to the database, but that would not be efficient.
I am not sure the best way to accomplish this.
[DataObjectMethod(DataObjectMethodType.Select)]
public List<int> MethodA(int input)
{
List<int> a = new List<int>();
List<string> b = new List<string>();
///
/// Make one call to database
/// returns: List<int> and List<string>
/// set 'a' and 'b' values.
return a;
}
[DataObjectMethod(DataObjectMethodType.Select)]
public List<string> MethodB()
{
List<string> b = new List<string>();
///
/// When MethodA is called set 'b'
///
return b;
}