One way of doing this, is, before this line
RecordsdataGridView.Rows.RemoveAt(rowIndex);
read the required (index) data from the selected DataGrid Row, and use that to run a 'delete from table where id = index-from-datarow' sort of thing - making sure you do the SQL properly, ie, no SQL injection, use a parameterized SQL statement.
If the DataGrid Row doesn't have an index or something to form a unique delete statement, then I suggest you change your original query to obtain it, but make the DataGrid column hidden so it doesnt display
Probably a better way of achieving the update/delete of an 'underlying' database table from a DataGridView is to 'bind' the DataGridView to the data-source (db table) - here's a link that may help illustrate this
Database Updates From DatagridView[
^]