1 Reply Latest reply on Jan 13, 2017 1:11 PM by tdanner

    Orion SDK - Does anyone know how to build the Interface list Dynamically

    robdogaz

      My current code is

       

      string BuildQuery = @"from myRow in dt.AsEnumerable()"

                                                  + " where " + strInput.ToString().Substring(strInput.Length - 3) + " "

                                                  + " select myRow";

                          DataTable dt = Tabulate(GetInterfaces(swisClient, nodeId.ToString()).ToString());

       

       

                          EnumerableRowCollection<DataRow> query = from myRow in dt.AsEnumerable()

                                                                   where myRow.Field<string>("Caption").StartsWith("Tunnel100") ||

                                                                   myRow.Field<string>("Caption").StartsWith("GigabitEthernet0/0/0") ||

                                                                   myRow.Field<string>("Caption").StartsWith("GigabitEthernet0/0/1") ||

                                                                   myRow.Field<string>("Caption").StartsWith("T1 0/1/0") ||

                                                                   myRow.Field<string>("Caption").StartsWith("Serial0/1/0:1") ||

                                                                   myRow.Field<string>("Caption").StartsWith("Serial0/1/0:100")

                                                                   select myRow;

                          DataView view = query.AsDataView();

       

      When I try to pass BuildQuery like

      EnumerableRowCollection<DataRow> query = from myRow in dt.AsEnumerable() BuildQuery - I get cannot cast from string to EnumerableRowCollection<DataRow>