Server Error in '/' Application.

Violation of PRIMARY KEY constraint 'PK_Sgm_New_Settings'. Cannot insert duplicate key in object 'dbo.Sgm_New_Settings'. The duplicate key value is (Fa, 2, 25, 1, AlterBackColor, 0).
Cannot insert the value NULL into column 'Code', table 'idsms_sgsql.dbo.Sgm_New_CtgTemplate'; column does not allow nulls. INSERT fails.
The statement has been terminated.
The statement has been terminated.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint 'PK_Sgm_New_Settings'. Cannot insert duplicate key in object 'dbo.Sgm_New_Settings'. The duplicate key value is (Fa, 2, 25, 1, AlterBackColor, 0).
Cannot insert the value NULL into column 'Code', table 'idsms_sgsql.dbo.Sgm_New_CtgTemplate'; column does not allow nulls. INSERT fails.
The statement has been terminated.
The statement has been terminated.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PK_Sgm_New_Settings'. Cannot insert duplicate key in object 'dbo.Sgm_New_Settings'. The duplicate key value is (Fa, 2, 25, 1, AlterBackColor, 0).
Cannot insert the value NULL into column 'Code', table 'idsms_sgsql.dbo.Sgm_New_CtgTemplate'; column does not allow nulls. INSERT fails.
The statement has been terminated.
The statement has been terminated.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +388
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +815
   System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4515
   System.Data.SqlClient.SqlDataReader.TrySetMetaData(_SqlMetaDataSet metaData, Boolean moreInfo) +403
   System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +3576
   System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +69
   System.Data.SqlClient.SqlDataReader.get_MetaData() +134
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +6553981
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) +6556619
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +586
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +104
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +288
   System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +171
   System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +15
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +325
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +420
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +275
   sitesaz.classLib.SqlHelper.ExecuteDataset(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) +213
   sitesaz.post.New_News.GetSectionComplete(String Lang, Int32 ModCode, String SecPath, Int32 SecCode, Int32 PageCode, String PageIndexStr) +335
   sitesaz.post.postNewsSection.ShowNews() +651
   sitesaz.post.postNewsSection.InitializeSkin(Control Skin) +17444
   sitesaz.classLib.SkinnedMultiLangControl.CreateChildControls() +335
   System.Web.UI.Control.EnsureChildControls() +189
   System.Web.UI.Control.PreRenderRecursiveInternal() +60
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4297


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009