title: Getting Error as "input array is longer than the number of columns in this table"
body: <p>Code.</p>
  
  <pre><code>Public Function comb1(ByVal SName As String) As DataTable
  
          Dim dt As New DataTable
          cmd = New SqlCommand("Select Distinct RName from tb_RS_New", con)
          dr2 = cmd.ExecuteReader
          While (dr2.Read())
              dt.Rows.Add(dr2("RName"))
          End While
          Return dt
  
  End Function
  </code></pre>
  
  <p>While loading the page, the error was thrown as "input array is longer than the number of columns in this table"</p>
  
  <p>What wrong in my code.</p>
  
  <p>Need Help</p>