I made a c# web services and in other hand i have a C# winform that consume that webservices, the problem is: the web services returns a DATASET with more of 5000 rows and a get a error
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.
Here is the code of the webservice:
[WebMethod]
public DataSet cuentaAtrasadas()
{
SqlConnection myConnection = new SqlConnection("Data Source=192.168.87.15;" + "Initial Catalog=Indar;" + "User id=sa;" + "Password=;");
DataSet ds = new DataSet();
string query = "Select Zona = Rama, CxcInfo.Cliente, Cte.Nombre, Movimiento = CxcInfo.Mov,cxcinfo.estatus, NumDoc = CxcInfo.MovID, CxcInfo.Referencia, Oc.MovId, Comentarios = SubString(Cxc.Comentarios,1,50), " +
"FechaEmision = Convert(Char(10), CxcInfo.FechaEmision, 103), Vencimiento = Convert(Char(10), CxcInfo.Vencimiento, 103), Dias = CxcInfo.DiasMoratorios, Importe = (Cxc.Importe + Cxc.Impuestos), Saldo = CxcInfo.Saldo, " +
" FormaPago = Cte.Descripcion7, cxc.comentariosCyc, cxc.comentariosGte, cxc.fechacomp,cxc.responsablecxc FROM CxcInfo Left Outer Join Cte On CxcInfo.Cliente=Cte.Cliente Left Outer Join (Select Mov, MovId, EstatusOC, Docto, EstadoDocto " +
" From ( Select E.Mov, E.MovId, EstatusOC = E.Estatus, E.FechaRegistro, Docto = Em.Mov+' '+Em.MovId, EstadoDocto = Ed.Estado, Rank() Over (Partition By Em.MovId Order By E.FechaRegistro Desc) As 'UltEmbF' " +
" From Embarque E Left Outer Join EmbarqueD Ed ON E.ID = Ed.ID Left Outer Join EmbarqueMov Em ON Ed.EmbarqueMov = Em.Id Where E.Empresa = 'FIN' And Em.Modulo = 'CXC' And Em.Mov = 'Factura Indar' " +
" And E.Mov = 'Orden Cobro' ) Ue Where UltEmbF = 1 ) Oc On Oc.Docto = CxcInfo.Mov+' '+CxcInfo.MovId , Cxc WHERE Cxc.Cliente = Cte.cliente And Cxc.Id = CxcInfo.Id And CXCInfo.Empresa = 'FIN' " +
" And (CxcInfo.Cliente Not In ('C000006') And CxcInfo.Cliente Not Like '[D,E,S,FSF,FIN]%') And (CxcInfo.Saldo <> 0 And Cxc.Saldo <> 0) and rama='Z130' Order By CxcInfo.Mov";
SqlDataAdapter da = new SqlDataAdapter(query, myConnection);
da.SelectCommand.CommandTimeout = 0;
da.Fill(ds, "CTE");
return ds;
}
and the code of the client:
ServiceReference1.Service1SoapClient soap = new ServiceReference1.Service1SoapClient();
DataSet ds = soap.cuentaAtrasadas();
gridControl1.DataSource = ds.Tables[0].DefaultView;
And I get the error in this line: DataSet ds = soap.cuentaAtrasadas(); but where do i increase the MaxReceivedMessageSize property?