Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I dont know what mistake i did in my query.



 Executing Sql 'insert into "dbo"."OHSEvent"("Oid","Created","CreatedBy","LastModified","ModifiedBy","IsArchived","Caption","Enterprise","AssignedLocation","AllDay","Description","StartOn","EndOn","Subject","Type","OptimisticLockField","GCRecord","ObjectType")values(@p0,@p1,@p2,@p3,@p4,@p5,@p6,@p7,@p8,@p9,null,@p10,@p11,@p12,@p13,@p14,null,@p15) set @r=1' with parameters '{4020a2a3-a693-4fb1-a468-dc299f601cb3},{5/28/2013 5:25:14 PM},{ad09bc77-5e88-4b93-b0fc-127e39adee56},{5/28/2013 5:26:33 PM},{ad09bc77-5e88-4b93-b0fc-127e39adee56},{False},{2/6/2014 11:45 AM: Patient Reminder   Patient needs MRI Cerical ...},{d8a9d05d-555a-4e69-9429-2a92726e0306},{cfe3df1e-c772-4037-a9b7-f5acb0361dda},{False},{2/6/2014 11:45:00 AM},{2/6/2014 12:00:00 PM},{WILLIAM, WEAVER : Patient Reminder   Patient needs MRI Cerical s...},{0},{0},{69},{1}' exception 'System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at DevExpress.Xpo.DB.MSSqlConnectionProvider.<>c__DisplayClass2.<Exec>b__0()'
Posted
Comments
CHill60 28-May-13 8:02am    
The query is probably fine, but the values you are attempting to insert may not fit the column sizes you have defined
[no name] 28-May-13 8:02am    
Neither would we. You are trying to insert a value into a column in your database that is too large to fit.
tumbledDown2earth 28-May-13 8:09am    
Please check the value that you are inserting, and the size of database columns. There may be possibility that your one of the column datatype is allowing less then what you are inserting, I will suggest you to use SQL Profiler

1 solution

This exception occures when your datatype,size does not match with database field attributes.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900