title: Deleting-Updating a dataview
body: <p>I need your help PLEASE!
  I have a table: tblCustomer. (serial,Name,Email,Address)</p>
  
  <p>I did the following:
  insert-update-delete in dataset(that contains the table tblCustomer)</p>
  
  <p>What I need to do, and I need your help in it, is:
  insert-update-delete in dataview.
  I tried to do the following:</p>
  
  <pre><code> Dim dv As New DataView(_DataSet.Tables(0))
          ' select deleted rows 
          dv.RowStateFilter = DataViewRowState.Deleted
          For _irow As Long = 0 To dv.Table.Rows.Count - 1
              ' if serial is null, that means the row is new and deleted 
              ' so no need to add it to database 
              If Not IsDBNull(dv!serial) Then
                  ' delete row from database 
                  Dim _SQL As String = "DELETE FROM tblCustomer WHERE Serial = " &amp; dv!serial.ToString
                  ' open the connection and execute the delete command 
                  Dim strconnection As String = "Data Source=EASMAR-PC;Initial Catalog=Database Connection;Integrated Security=True;"
                  Dim _cn As SqlConnection = New SqlConnection(strconnection)
                  _cn.Open()
                  Dim cmd As New SqlCommand
                  cmd.CommandText = "Delete from tblCustomer where serial= '" &amp; txtSerial.Text &amp; "'"
  
              End If
          Next
  </code></pre>
  
  <p>I am getting this error: <code>Conversion from string "serial" to type 'Integer' is not valid.</code>
  On this line: <code>If Not IsDBNull(dv!serial) Then</code>
  And the same error on: <code>Dim _SQL As String = "DELETE FROM tblCustomer WHERE Serial = " &amp; dv!serial.ToString</code></p>
  
  <p>Can you help me PLEASE.
  Thank you.</p>