Results 1 to 4 of 4

Thread: Exclude last record from DatagridView while retrieving data -Using SQL Server

Threaded View

  1. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,514

    Re: Exclude last record from DatagridView while retrieving data -Using SQL Server

    Get the number of rows in the datatable using the "count" method. Then delete the last record using the "Delete" method.

    Code:
    Dim count = datatable.rows.Count
    If count > 0 Then
        datatable.rows(count-1).Delete
    End If
    Last edited by wes4dbt; Jun 24th, 2026 at 07:34 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width