1
To take the value of datagrid would just be that:
var valordacelular = DataGridView3.CurrentCell.Value;
It is not indicated that you concatenate the direct value in string do not, below how your line would look, but that is not advisable.
SQLcmd.CommandText = ("DELETE FROM usuario WHERE nome = '" & DataGridView3.CurrentCell.Value & "' ");
The correct thing would be for you to add parameters within the String thus:
SQLcmd.CommandText = ("DELETE FROM usuario WHERE nome = @param1");
SQLcmd.CommandType = CommandType.Text;
SQLcmd.Parameters.Add(new SQLiteParameter("@param1", DataGridView3.CurrentCell.Value));
I understand, but your leave as you said my line would stay and it is not advisable, would have some execution problem?
– Everton Souza Santos
There would be no execution problem.
– Ricardo
i left it this way Sqlcmd.Commandtext = ("DELETE FROM user WHERE id = '" & Datagridview3.CurrentRow.Cells(0). Value & "' "
– Everton Souza Santos
This, in case you take the selected line and the zero cell of it, will take the value of the id you want yes. Good that it helped you, if it answered your question does not fail to schedule answer.
– Ricardo
thank you, help yes :)
– Everton Souza Santos