title: If the MAC adress already exists, it keeps it, otherwise it will continue to run normally
body: <p>I need that if the MAC address is already stored in the database, it does not save and continues to run the program, but if it does not have that MAC address it saves only that I do not know how to put it in an &quot;IF&quot;:</p>
  <pre><code>if (macAddr != macAddr)
                  {
                      SqlDataAdapter ee = new SqlDataAdapter(&quot;[dbo].[dbo.Bi_DispositivoInset]&quot;, ss);
                      ee.SelectCommand.CommandType = CommandType.StoredProcedure;
                      ee.SelectCommand.Parameters.Add(&quot;@disp_mac&quot;, SqlDbType.NVarChar, (17)).Value = macAddr;
                      ee.SelectCommand.Parameters.Add(&quot;@disp_nom&quot;, SqlDbType.VarChar,(50)).Value = nomeCompleto;
                      ee.SelectCommand.Parameters.Add(&quot;@ID_interno_cc&quot;, SqlDbType.Int).Value = &quot;1&quot;;
                      ee.SelectCommand.ExecuteNonQuery();
                      ss.Close();
                      
                       foreach (var s in SerialPort.GetPortNames())
                  {
  </code></pre>
  <p>I know it's not like that but I'm new ...</p>