I making a database and I can add names, but I can't remove please help me.
This is my code:
private void button2_Click(object sender, EventArgs e)
{
using (connection = new SqlConnection(connectionString))
using (SqlCommand cmds = new SqlCommand("DELETE FROM Recipe WHERE firstName = @user", connection))
{
connection.Open();
cmds.Parameters.AddWithValue("@user", cmds);
cmds.ExecuteNonQuery();
}
populateRecipe();
}
This is the error
An unhandled exception of type
System.ArgumentException
occurred inSystem.Data.dll Additional
information: No mapping exists from object typeSystem.Data.SqlClient.SqlCommand
to a known managed provider native type.