Sorting a particular column of datatable of string type that contains numeric data
<p>I have a datatable (.Net) with multiple columns. One of the columns say RollNo is of string type but contains numeric data. Eg. <strong>1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14</strong>. I am trying to sort using the following:</p>

<pre><code>string sql = 
  "Select StudentID, RollNo, AdmissionID,(FirstName + Space(1) + Isnull(MiddleName,'') + Space(1) + Isnull(LastName,'')) as Name," +
  " PermState as State from Students where ClassId  = '" + ddlClass.SelectedValue + "'" +
  " order by RollNo";

DataTable dt = bl.GetDataSet(sql);       
dt.DefaultView.Sort = "RollNo";  
</code></pre>

<p>But after sorting I get the result as <strong>1, 10, 11, 12, 13, 14, 2, 3, 4, 5, 6, 7, 8, 9.</strong></p>

<p>How to solve it? </p>
