NoReg |Emresa |Caracteristicas |Origen |Destino 3 |INFOTEP |MINIBUS CONFORTABLE |LA VEGA |PUERTO PLATA 3 |INFOTEP |MUSICA TELEVISOR WIFI |MAO |SANTO DOMINGO OESTE 3 |INFOTEP |MUSICA TELEVISOR WIFI |MONTECRISTI |SANTIAGO DE LOS CABALLEROS 3 |INFOTEP |MUSICA TELEVISOR WIFI |LA VEGA |SANTO DOMINGO NORTE
NoReg |Emresa |Caracteristicas |Origen |Destino 3 |INFOTEP |MINIBUS CONFORTABLE |LA VEGA |PUERTO PLATA 3 |INFOTEP | |MAO |SANTO DOMINGO OESTE 3 |INFOTEP |MUSICA TELEVISOR WIFI |MONTECRISTI |SANTIAGO DE LOS CABALLEROS 3 |INFOTEP | |LA VEGA |SANTO DOMINGO NORTE
DataSet ds = ReceiptDataDAL.GetData(val); DataTable dtResult = ds.Tables[0].Copy(); DataTable dt = new DataTable(); DataColumn dc = new DataColumn("col1", typeof(String)); dt.Columns.Add(dc); // var dt1 = ds.Tables[0].AsEnumerable() //.Select(g => g.Field<string>("Caracteristicas")).Distinct().OrderBy(k => k).ToArray(); var distinctRows = ds.Tables[0].AsEnumerable() .Select(g => g.Field<string>("Caracteristicas")).Distinct().OrderBy(k => k).ToArray(); DataRow dr = dt.NewRow(); foreach (string name in distinctRows) { int i = 0; var rows = ds.Tables[0].Select("Caracteristicas = '" + name + "'"); string value = ""; foreach (DataRow row in rows) { value += row["Caracteristicas"] + "\n"; } value = value.Trim(','); dr[0] = value; dt.Rows.Add(value); dt.Rows.InsertAt(dr,0); value = ""; i++; } var output = dtResult;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)