title: The INSERT statement conflicted with the CHECK constraint
body: <p>Can any body give the suggestions.Why I am getting this error.</p>
  
  <p>System.Data.SqlClient.SqlException: The INSERT statement conflicted with the CHECK constraint "CK_<em>GL10000</em>_TRXDATE__56701F76". The conflict occurred in database "TWO", table "dbo.GL10000", column 'TRXDATE'.</p>
  
  <p>This is my stored procedure :</p>
  
  <pre><code>SqlCommand myCommand1 = new SqlCommand("taGLTransactionHeaderInsert", strcon);
  
    myCommand1.CommandType = CommandType.StoredProcedure;
  
    myCommand1.CommandText = "taGLTransactionHeaderInsert";
  
    myCommand1.Parameters.Add("@I_vBACHNUMB", SqlDbType.Char).Value = GLHdr.BACHNUMB;
  
    myCommand1.Parameters.Add("@I_vREFRENCE", SqlDbType.Char).Value = "ExcelImport";
  
    myCommand1.Parameters.Add("@I_vTRXDATE", SqlDbType.DateTime).Value = GLHdr.TRXDATE;
  </code></pre>
  
  <p>Table definition:</p>
  
  <pre><code>CREATE TABLE [dbo].[GL10000](
  
  [PSTGSTUS] [smallint] NOT NULL,
  
  [LASTUSER] [char](15) NOT NULL,
  
  [LSTDTEDT] [datetime] NOT NULL,
  
  [USWHPSTD] [char](15) NOT NULL,
  
  [TRXTYPE] [smallint] NOT NULL
  
      /* More columns? not included in script that OP added */
  )
  GO
  
  ALTER TABLE [dbo].[GL10000]  WITH CHECK ADD CHECK
    ((datepart(hour,[RVRSNGDT])=(0) AND datepart(minute,[RVRSNGDT])=(0)
    AND datepart(second,[RVRSNGDT])=(0) AND datepart(millisecond,[RVRSNGDT])=(0)))
  GO
  
  ALTER TABLE [dbo].[GL10000]  WITH CHECK ADD CHECK
    ((datepart(hour,[Tax_Date])=(0) AND datepart(minute,[Tax_Date])=(0)
    AND datepart(second,[Tax_Date])=(0) AND datepart(millisecond,[Tax_Date])=(0)))
  GO
  
  ALTER TABLE [dbo].[GL10000]  WITH CHECK ADD CHECK
    ((datepart(day,[TIME1])=(1) AND datepart(month,[TIME1])=(1)
    AND datepart(year,[TIME1])=(1900)))
  GO
  
  ALTER TABLE [dbo].[GL10000]  WITH CHECK ADD CHECK
    ((datepart(hour,[TRXDATE])=(0) AND datepart(minute,[TRXDATE])=(0)
    AND datepart(second,[TRXDATE])=(0) AND datepart(millisecond,[TRXDATE])=(0)))
  GO
  
  ALTER TABLE [dbo].[GL10000] ADD  CONSTRAINT
    [DF__GL10000__DEX_ROW__540C7B00]  DEFAULT (getutcdate()) FOR [DEX_ROW_TS]
  GO
  </code></pre>