i can't explain why by when i change the resolution of the pc images appear bigger.

have you checked the screen resolution of the other pcs?

sorry i answered in a hurry! didn't notice the different name on the post. although i did ask what's wrong with the new code cause it seems fine.

Josef01 on the first code you posted you need set the parameter @id in the following query. that is why you get the error "No value given for one or more required parameters."

Dim sqlstring As String = "Delete from sample where id =@id"
somewhere you need to add what @id is.

use this command
cmd.addparameterwithvalue('@id',[the selected row ID])

Oh you changed it! what's is the problem with this code?

First of all you are using an sql that need a parameter (@ID) and you don't provide that parameter. you need to tell the db what is that ID that you want to delete.

cmd.addparameterwithvalue('@id',[the selected row ID])

Secondly i would first delete from the Database and from the grid as if deleting from the Database fails you should warn your user and not remove it from the grid.

Thirdly, you should put some error handling whenever you are interacting with the Database (try catch statements) and see whether the deletion was successful.

Lastly, I think that your error messages you show to the user are really long. make your messages to the user simple short and clear (but that just my personal taste)

If you are not going to sort your rows at runtime you can also sort them when you retrieve them from the Database

You should close the tread then

there is not difference between those two except the fact that one of them is more readable because you used with [] statement

Public Class Form1
Inherits System.Windows.Forms.Form