I have a databse where the user can track new models coming into shop but they only keep one of each model, I'm not sure how to stop the user from repeating the same model. I've seen some previous answers on this site but I'm getting errors when using the code in my own.
private void check_Click(object sender, EventArgs e)
{
string query = "INSERT INTO tbl_phones(model) VALUES(@model)";
using (SqlConnection sqlconn = new SqlConnection(@""))
using (SqlCommand comm = new SqlCommand(query, sqlconn))
{
sqlconn.Open();
comm.Parameters.Add("@model, SqlDbType.NVarChar).Value = phoneinput.Text;
comm.ExecuteNonQuery();