If record exists dont insert
<p>I'm trying something out but cant figure it out. So what i'm trying is that if the user inputs something inside txtISN and it already exists inside of the database, the record wont be inserted. I also want a error msg to pop up when a record wasnt inserted and when a record is inserted I want an message to pop up saying that the record was inserted succesfully.</p>

<p>Thanks for the help y'all!</p>

<pre><code> string _connStr = @"Data Source = EJQ7FRN; Initial Catalog = BES; Integrated Security = True";
                string _query = "INSERT INTO [BES_S] (ISN,Titel,Name) values (@ISN,@Titel,@Name)";
                using (SqlConnection conn = new SqlConnection(_connStr))
                {
                    using (SqlCommand comm = new SqlCommand())
                    {
                        comm.Connection = conn;
                        comm.CommandType = CommandType.Text;
                        comm.CommandText = _query;
                        comm.Parameters.AddWithValue("@ISN", txtISN.Text);
                        comm.Parameters.AddWithValue("@Titel",txtTitel.Text);
                        comm.Parameters.AddWithValue("@Name", txtName.Text);
                        try
                        {
                            conn.Open();
                            comm.ExecuteNonQuery();
                        }
                        catch (SqlException ex)
                        {

                        }
                    }
                }
</code></pre>