Discuz!NT官方社区

首页 » Discuz!NT交流与讨论 » 数据转换 » 违反了 PRIMARY KEY 约束 'PK_dnt_posts1'。不能在对象 'dnt_posts1' 中插入重复键
udud - 2007-4-14 12:38:00
我刚刚遇到的问题,这是怎么回事呢?

违反了 PRIMARY KEY 约束 'PK_dnt_posts1'。不能在对象 'dnt_posts1' 中插入重复键。
语句已终止。
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: 违反了 PRIMARY KEY 约束 'PK_dnt_posts1'。不能在对象 'dnt_posts1' 中插入重复键。
语句已终止。

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

  <%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
  <system.web>
      <compilation debug="true"/>
  </system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
戏水 - 2007-4-15 22:28:00
您是在发帖的时候出现这个问题么? 如果是
那么请 参考 http://nt.discuz.net/showtopic-9397.html  第一
1
查看完整版本: 违反了 PRIMARY KEY 约束 'PK_dnt_posts1'。不能在对象 'dnt_posts1' 中插入重复键