Click here to Skip to main content
11,790,816 members (59,039 online)
Rate this: bad
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">
<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.
The data for table-valued parameter "@WISR_DATA" doesn't conform to the table type of the parameter.
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)</binding>
Posted 21-Jun-13 0:52am
Edited 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 at 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 at 21-Jun-13 7:26am
You should be able to get this from the Databas schema.
mahinder.singh.chauhan at 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 at 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
0 OriginalGriff 385
1 ppolymorphe 339
2 Richard MacCutchan 118
3 Maciej Los 70
4 George Swan 70
0 OriginalGriff 1,154
1 Maciej Los 825
2 KrunalRohit 686
3 ppolymorphe 660
4 CPallini 621

Advertise | Privacy | Mobile
Web01 | 2.8.1509028.1 | Last Updated 21 Jun 2013
Copyright © CodeProject, 1999-2015
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