You are currently browsing the monthly archive for February 2011.

After uploading data from a spreadsheet into an Oracle table it turned out there were duplicate records in the data that I wasn’t expecting. It’s quite easy to select unique records using ‘distinct’, but it’s a bit trickier to select duplicates which requires the use of the ‘having’ clause.  The duplicate field was called sec_code so here’s the code I used:

select * from SECURITIES where SEC_CODE IN(

group by SEC_CODE
having ( COUNT(SEC_CODE) > 1 )
) order by sec_code;

I was returning some records in a web form from a database table through a WCF method. The table had 3 records and everything was working fine. I added a couple of hundred records to the table and went home for the evening, happy that I got the page working. However the next day when I tried to retrieve the records again I got an error:

The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

So after a bit of searching I found the answer. The default settings for max buffer size and max receive message size are 65536. To get over the error I needed to up these settings to a number larger than the size of the message being returned. In the client web.config file I changed the following values:

maxBufferSize=”65535″  and maxReceivedMessageSize=”65535″


maxBufferSize=”5000000″  maxReceivedMessageSize=”5000000″

The reason this happend is that I am using paging on my other web forms and only returning 25 records per page, so the receive message size was ever that big. However the web form it happened on doesn’t have paging so when a couple of hundred records get inserted into the database the thing fell over. I had also read that these values need to be set in the service confif file also, but so far I haven’t done this – setting them just on the client worked.

%d bloggers like this: