title: Sort string items in a datatable as int using c#
body: <p>I have some numeric codes stored in a DataTable. When I try to sort it using DataView it sorts the column by string. What is the easiest way to sort the data as integer/number?</p>
  
  <pre><code>DataView view = dt.DefaultView();
  view.Sort = "Code asc";
  dt = view.ToTable();
  </code></pre>
  
  <p>Data in datatable:
  128, 123, 112, 12, 126</p>
  
  <p>after sort it shows:
  112, 12, 123, 126, 128</p>
  
  <p>expected result:
  12, 112, 123, 126, 128</p>