title: How can i sort Generic list with Linq?
body: <p>How can i sort  myScriptCellsCount.MyCellsCharactersCount (list int type) in linq</p>
  
  <pre><code>    public class MyExcelSheetsCells
      {
          public List&#60;int&#62; MyCellsCharactersCount { get; set; }
  
          public MyExcelSheetsCells()
          {
              MyCellsCharactersCount = new List&#60;int&#62;();
          }
  
      }</code></pre>
  
  <pre><code>   void ArrangedDataList(DataTable dTable)
          {
              DAL.MyExcelSheets myexcelSheet = new DAL.MyExcelSheets();
              myScriptCellsCount = new TestExceltoSql.DAL.MyExcelSheetsCells();
  
              foreach (DataColumn col in dTable.Columns)
                  myexcelSheet.MyColumnNames.Add(col.ColumnName.ToString());
              foreach(DataColumn dc in dTable.Columns)
              foreach (DataRow  dr in dTable.Rows)
                  myScriptCellsCount.MyCellsCharactersCount.Add(dr[dc].ToString().Length);
            //How can i sort desc
              //myScriptCellsCount.MyCellsCharactersCount = from list in myScriptCellsCount.MyCellsCharactersCount
              //                                            orderby list.CompareTo( descending
              //                                            select list;
              CreatSqlTable(myexcelSheet.MyColumnNames, dTable.TableName, myScriptCellsCount.MyCellsCharactersCount[0].ToString());
              myscript.WriteScript(myscript.SqlScripts);
          }</code></pre>