Click here to Skip to main content
13,000,017 members (46,180 online)
Rate this:
Please Sign up or sign in to vote.
<binding name="BasicHttpBinding_IPortalAPI" closetimeout="00:01:00" opentimeout="00:01:00" receivetimeout="00:10:00" sendtimeout="00:01:00" bypassproxyonlocal="false" hostnamecomparisonmode="StrongWildcard" maxbufferpoolsize="524288" maxreceivedmessagesize="2000000" messageencoding="Text" textencoding="utf-8" usedefaultwebproxy="true" allowcookies="false"><br />
          <readerquotas maxdepth="32" maxstringcontentlength="2000000" maxarraylength="16384" maxbytesperread="4096" maxnametablecharcount="16384" />

I have increase the size of maxReceivedMessageSized =2000000 to 200000000

during saving the data it showingh exception

System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated.<br />
The data for table-valued parameter "@WISR_DATA" doesn't conform to the table type of the parameter.<br />
The statement has been terminated.<br />
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)<br />
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)<br />
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()<br />
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)<br />
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)<br />
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)<br />
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)<br />
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)</binding>
Posted 21-Jun-13 0:52am
Updated 21-Jun-13 0:55am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I guess this error is not at service layer but at database layer. Check the size of the variable @WISR_DATA and the table where you are trying to save. one of it might have the capacity less than the size of the data. Hope this gives you clue where to look at.
mahinder.singh.chauhan 21-Jun-13 7:03am
sir i have taken data table so i don't know what is the lenght of datatable how can i resolve this error any suggesstion
ArunRajendra 21-Jun-13 7:26am
You should be able to get this from the Databas schema.
mahinder.singh.chauhan 21-Jun-13 9:05am
Sir in database i have taken User-defined table type how can i reslove this or need to change please help me out thanks in advance
ArunRajendra 21-Jun-13 13:44pm
if you have access to database use sp_help tablename to show the fields and its length.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170624.1 | Last Updated 21 Jun 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100