Tenho este código para inserir valores numa tabela:
conn.Open();
comm.CommandText = @"INSERT INTO ArticleBarCode(Code, Code_Article, BarCode, CreatedBy, CreatedOn, ModifiedBy, ModifiedOn, IsDeleted)
VALUES (@code, @codearticle, @barcode, 1, @date, 1, @date, 0)";
comm.Parameters.AddWithValue("@code", next);
comm.Parameters.AddWithValue("@codearticle", code);
comm.Parameters.AddWithValue("@barcode", numbercode);
comm.Parameters.AddWithValue("@date", DateTime.Now);
comm.ExecuteNonQuery();
conn.Close();
Mas quando executo dá-me este erro:
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_ArticleBarCode_Article". The conflict occurred in database "CardozuGestDB", table "dbo.Article", column 'Code'.
Como posso resolver isto ?