public static MemoryStream DataTableSerialization(DataTable dtSearchDataTable) { System.IO.MemoryStreamstream = newSystem.IO.MemoryStream(); System.Runtime.Serialization.IFormatterformatter = newSystem.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); byte[] bytes = null; MemoryStream memory = new MemoryStream(); try { dtSearchDataTable.RemotingFormat = SerializationFormat.Binary; formatter.Serialize(stream, dtSearchDataTable);//Here i am getting error bytes = stream.ToArray(); using (vargzip = newGZipStream(memory, CompressionMode.Compress, true)) { gzip.Write(bytes, 0, bytes.Length); } memory.Position = 0; // --- In order to enable reading option during Deserialzation on client side we need to set Position = 0 } catch(Exceptionex) { } finally { stream.Dispose(); MinimizeMemory(); } return memory; }
<opentimeout receivetimeout="04:10:00" sendtimeout="04:01:00"> bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotasmaxdepth maxstringcontentlength="2147483647" maxarraylength="2147483647"> maxBytesPerRead="4096"maxNameTableCharCount="16384"/> bindingname="SearchBinding"closeTimeout="04:01:00"> </readerquotasmaxdepth> </opentimeout>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)