DataAccessLayer.DataBase.DeleteComment C# (CSharp) Method

DeleteComment() public method

public DeleteComment ( System.Guid comid ) : void
comid System.Guid
return void
        public void DeleteComment(Guid comid)
        {
            var queryString = "DELETE FROM [dbo].[comments] " +
                              "WHERE comments.comid = @comid;";
            using (SqlConnection connection = new SqlConnection(_connectionString))
            {
                var command = new SqlCommand(queryString, connection);

                command.Parameters.AddWithValue("comid", comid);

                try
                {
                    connection.Open();
                    command.ExecuteNonQuery();
                }
                catch (Exception)
                {
                    throw;
                }
                return;
            }

            #endregion
        }