Click here to Skip to main content
15,900,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have some objects created in my class but have more then one IList with my items from each list box. I am trying to figure out how to run one query to combine all of them and bind to a grid. Each list has a Unique ID which can then be used as part of the query. The project number is the UID which I have in my search class for each listbox. Here is the last function I am trying to build.

C#
public void geteverythingforGRID()
{

    List<SearchClass> siList = new List<SearchClass>();
    List<SearchClass> siListREP = new List<SearchClass>();
    DataTable dtSomeOtherDTQuery = BuildEverythingGRIDTable(
              buildSaleRepQuery(), buildPMQuery());

    DataRow[] drsO = dtSomeOtherDTQuery.Select("REP <> '" + 
        String.Empty + "' PM <> '" + 
        String.Empty + "'");
        //This I can't figure out how to make it syntax correct
        //but is what I need?
    //DataRow[] drsO = dtSomeOtherDTQuery.Select("Sales_Rep <> '" + 
    //       String.Empty + "'");

    foreach (DataRow dr in drsO)
    {
         var s = from sr in siListREP
                   where sr.REP == dr["Sales_Rep"].ToString()
                   group sr by sr.REPEstimateNumber into g
                   join projmgr in siList on g.Key equals 
                         siList.PMEstimateNumber
                      orderby projmgr.PM
                      select new { projmgr.PM, projmgr.REP };

         foreach (var list in s)
         {
             gvSearch.DataSource = list;
             gvSearch.DataBind();
         }
    }
}
Posted
Updated 19-Mar-10 9:44am
v4

1 solution

This makes no sense at all and isn't even a valid statement

VB
dtSomeOtherDTQuery.Select("REP <> '" +
    String.Empty + "' PM <> '" + 
        String.Empty + "'");


it translates to

dtSomeOtherDTQuery.Select("REP <> '' PM <> '');
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900