title: Converting DataView to DataTable
body: <p>I have a form with <strong>Search User Button</strong> when I select the button the modal popup extender will show and user can search all the employees, when select value, the value selected should pass to the parent form with another gridview. </p>
  
  <p>Now, I have a code which convert dataview to datatable. When debugging the value of index (s) is not passing to (idx).</p>
  
  <pre><code>Dim RowIndex As Integer = gvUser.EditIndex
      Dim dt As New DataTable
      dt = TryCast(Session("dbCache_User"), DataView).Table.Clone
  
      Dim dv As New DataView(dt, "", "USR_IDNTY", DataViewRowState.OriginalRows)
      Dim s As String = TryCast(gvUser.Rows(RowIndex).FindControl("lblUSR_IDNTY"), Label).Text
      Dim idx As Integer = dv.Find(s)
  
      dv(idx)("USR_ID") = row.Cells(1).Text
      dv(idx)("NAME") = row.Cells(2).Text
  
      gvUser.DataSource = dv
      gvUser.DataBind()
  </code></pre>
  
  <p>When I'm trying to debug. I try to search one row with index 4; the value of (s)  is 4 but when passing to (idx) it is -1.</p>
  
  <p>I need to find the value s.</p>