|
Problems with DataTable -- AlejandroR --
Hi Michael I have a problem when I'm trying to pass a DataTable to my JS. Maybe this can help to understand the problem. When I'm using something like this in my server Method: public DataTable DevolverDatosCorrida(string pCorrida, string pEscenario, short pIdUsuario) { MRP.EjecucionMRPDevolverDatosConfiguracionActionRequest req = MRPWrappers.EjecucionWrappers. EjecucionMRPDevolverDatosConfiguracionRequestWrapper( pCorrida, pEscenario); MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse res = (MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse) Generalidades.MBI.WrapperExecuteAction(req, pIdUsuario); //this is a datatable return res.Result.Result; } In my res.value I received this (res.JSON): "[[true,\"P1122\",\"Corrida 13/07\",new Date(Date.UTC(2006,6,14,14,41,2,687)),1,\"Supervisor de Summa \",\"Prue1 \",\"Escenario Prueba eje\",null,5,2,false,false,null,false,null,false,false,5,false,null,\"RF \"]];/*" So as you can see this is not a DataTable Why? Well, now I'm trying something different: I change my DataSet for a string type: public string DevolverDatosCorrida(string pCorrida, string pEscenario, short pIdUsuario) { MRP.EjecucionMRPDevolverDatosConfiguracionActionRequest req = MRPWrappers.EjecucionWrappers. EjecucionMRPDevolverDatosConfiguracionRequestWrapper( pCorrida, pEscenario); MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse res = (MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse) Generalidades.MBI.WrapperExecuteAction(req, pIdUsuario); AjaxPro.DataTableConverter aj = new AjaxPro.DataTableConverter(); string ajSer = aj.Serialize(res.Result.Result); //this is an string return ajSer; } In my JS I received this in my res.value: "new Ajax.Web.DataTable( ,[[true,\"P7777\",\"12/7\", new Date(Date.UTC(2006,6,12,15,58,22,523)),1,\"Supervisor de Summa \",\"Prue1 \",\"Escenario Prueba eje\",null,5,2,false,false,null,false,null,false,false,5,false,null,\"RC \"]])" so I can use an eval() for use my DataTable dt = eval(res.value); And all is perfect, I don't know what could be happend, but when I use an old version 6.5.17.1 and all works fine. Can u help me? |
|
-- MichaelSchwarz --
Hi, are you using the latest version? There was a bug with own DataTables. Can you verify if this is fixed in current version? On 7/19/06, Alejandro R <aravenna> wrote: Hi Michael I have a problem when I'm trying to pass a DataTable to my JS. Maybe this can help to understand the problem. When I'm using something like this in my server Method: public DataTable DevolverDatosCorrida(string pCorrida, string pEscenario, short pIdUsuario) { MRP.EjecucionMRPDevolverDatosConfiguracionActionRequest req = MRPWrappers.EjecucionWrappers. EjecucionMRPDevolverDatosConfiguracionRequestWrapper( pCorrida, pEscenario); MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse res = (MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse) Generalidades.MBI.WrapperExecuteAction(req, pIdUsuario); //this is a datatable return res.Result.Result; } In my res.value I received this (res.JSON): "[[true,\"P1122\",\"Corrida 13/07\",new Date(Date.UTC(2006,6,14,14,41,2,687)),1,\"Supervisor de Summa \",\"Prue1 \",\"Escenario Prueba eje\",null,5,2,false,false,null,false,null,false,false,5,false,null,\"RF \"]];/*" So as you can see this is not a DataTable Why? Well, now I'm trying something different: I change my DataSet for a string type: public string DevolverDatosCorrida(string pCorrida, string pEscenario, short pIdUsuario) { MRP.EjecucionMRPDevolverDatosConfiguracionActionRequest req = MRPWrappers.EjecucionWrappers. EjecucionMRPDevolverDatosConfiguracionRequestWrapper( pCorrida, pEscenario); MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse res = (MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse) Generalidades.MBI.WrapperExecuteAction(req, pIdUsuario); AjaxPro.DataTableConverter aj = new AjaxPro.DataTableConverter(); string ajSer = aj.Serialize(res.Result.Result); //this is an string return ajSer; } In my JS I received this in my res.value: "new Ajax.Web.DataTable( ,[[true,\"P7777\",\"12/7\",new Date(Date.UTC(2006,6,12,15,58,22,523)),1,\"Supervisor de Summa \",\"Prue1 \",\"Escenario Prueba eje\",null,5,2,false,false,null,false,null,false,false,5,false,null,\"RC \"]])" so I can use an eval() for use my DataTable dt = eval(res.value); And all is perfect, I don't know what could be happend, but when I use an old version 6.5.17.1 and all works fine. Can u help me? > -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz /http://www.schwarz-interactive.de /Skype: callto:schwarz-interactive MSN IM: passport |
|
-- AlejandroR --
Yes Michael, I'm using your lastest version 6.7.19.1 and .Net framework 1.1 Regards Alejandro Michael Schwarz wrote: Hi, are you using the latest version? There was a bug with own DataTables. Can you verify if this is fixed in current version? On 7/19/06, Alejandro R <aravenna> wrote: > > Hi Michael > > I have a problem when I'm trying to pass a DataTable to my JS. > Maybe this can help to understand the problem. > > When I'm using something like this in my server Method: > > > public DataTable DevolverDatosCorrida(string pCorrida, string > pEscenario, short pIdUsuario) > { > MRP.EjecucionMRPDevolverDatosConfiguracionActionRequest req = > MRPWrappers.EjecucionWrappers. > EjecucionMRPDevolverDatosConfiguracionRequestWrapper( > pCorrida, pEscenario); > MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse res = > (MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse) > Generalidades.MBI.WrapperExecuteAction(req, pIdUsuario); > //this is a datatable > return res.Result.Result; > } > In my res.value I received this (res.JSON): > > "[[true,\"P1122\",\"Corrida 13/07\",new > Date(Date.UTC(2006,6,14,14,41,2,687)),1,\"Supervisor de Summa > \",\"Prue1 \",\"Escenario Prueba > eje\",null,5,2,false,false,null,false,null,false,false,5,false,null,\"RF > \"]];/*" > > So as you can see this is not a DataTable > Why? > > Well, now I'm trying something different: > I change my DataSet for a string type: > > > public string DevolverDatosCorrida(string pCorrida, string pEscenario, > short pIdUsuario) > { > MRP.EjecucionMRPDevolverDatosConfiguracionActionRequest req = > MRPWrappers.EjecucionWrappers. > EjecucionMRPDevolverDatosConfiguracionRequestWrapper( > pCorrida, pEscenario); > MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse res = > (MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse) > Generalidades.MBI.WrapperExecuteAction(req, pIdUsuario); > > AjaxPro.DataTableConverter aj = new AjaxPro.DataTableConverter(); > string ajSer = aj.Serialize(res.Result.Result); > //this is an string > return ajSer; > } > In my JS I received this in my res.value: > "new > Ajax.Web.DataTable( ,[[true,\"P7777\",\"12/7\",new > Date(Date.UTC(2006,6,12,15,58,22,523)),1,\"Supervisor de Summa > \",\"Prue1 \",\"Escenario Prueba > eje\",null,5,2,false,false,null,false,null,false,false,5,false,null,\"RC > \"]])" > > so I can use an eval() for use my DataTable > > dt = eval(res.value); > > And all is perfect, > > I don't know what could be happend, but when I use an old version > 6.5.17.1 and all works fine. > Can u help me? > > > > > -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz /http://www.schwarz-interactive.de /Skype: callto:schwarz-interactive MSN IM: passport |
|
-- AlejandroR --
Yes Michael, I'm using your lastest version 6.7.19.1 and .Net framework 1.1 Regards Alejandro Michael Schwarz wrote: Hi, are you using the latest version? There was a bug with own DataTables. Can you verify if this is fixed in current version? On 7/19/06, Alejandro R <aravenna> wrote: > > Hi Michael > > I have a problem when I'm trying to pass a DataTable to my JS. > Maybe this can help to understand the problem. > > When I'm using something like this in my server Method: > > > public DataTable DevolverDatosCorrida(string pCorrida, string > pEscenario, short pIdUsuario) > { > MRP.EjecucionMRPDevolverDatosConfiguracionActionRequest req = > MRPWrappers.EjecucionWrappers. > EjecucionMRPDevolverDatosConfiguracionRequestWrapper( > pCorrida, pEscenario); > MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse res = > (MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse) > Generalidades.MBI.WrapperExecuteAction(req, pIdUsuario); > //this is a datatable > return res.Result.Result; > } > In my res.value I received this (res.JSON): > > "[[true,\"P1122\",\"Corrida 13/07\",new > Date(Date.UTC(2006,6,14,14,41,2,687)),1,\"Supervisor de Summa > \",\"Prue1 \",\"Escenario Prueba > eje\",null,5,2,false,false,null,false,null,false,false,5,false,null,\"RF > \"]];/*" > > So as you can see this is not a DataTable > Why? > > Well, now I'm trying something different: > I change my DataSet for a string type: > > > public string DevolverDatosCorrida(string pCorrida, string pEscenario, > short pIdUsuario) > { > MRP.EjecucionMRPDevolverDatosConfiguracionActionRequest req = > MRPWrappers.EjecucionWrappers. > EjecucionMRPDevolverDatosConfiguracionRequestWrapper( > pCorrida, pEscenario); > MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse res = > (MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse) > Generalidades.MBI.WrapperExecuteAction(req, pIdUsuario); > > AjaxPro.DataTableConverter aj = new AjaxPro.DataTableConverter(); > string ajSer = aj.Serialize(res.Result.Result); > //this is an string > return ajSer; > } > In my JS I received this in my res.value: > "new > Ajax.Web.DataTable( ,[[true,\"P7777\",\"12/7\",new > Date(Date.UTC(2006,6,12,15,58,22,523)),1,\"Supervisor de Summa > \",\"Prue1 \",\"Escenario Prueba > eje\",null,5,2,false,false,null,false,null,false,false,5,false,null,\"RC > \"]])" > > so I can use an eval() for use my DataTable > > dt = eval(res.value); > > And all is perfect, > > I don't know what could be happend, but when I use an old version > 6.5.17.1 and all works fine. > Can u help me? > > > > > -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz /http://www.schwarz-interactive.de /Skype: callto:schwarz-interactive MSN IM: passport |
|
-- MichaelSchwarz --
Can you write the content of the data table to an xml file including the schema and send it back to me? Regards, Michael On 7/19/06, Alejandro R <aravenna> wrote: Yes Michael, I'm using your lastest version 6.7.19.1 and .Net framework 1.1 Regards Alejandro Michael Schwarz wrote: > Hi, are you using the latest version? There was a bug with own DataTables. > > Can you verify if this is fixed in current version? > > > > On 7/19/06, Alejandro R <aravenna> wrote: > > > > Hi Michael > > > > I have a problem when I'm trying to pass a DataTable to my JS. > > Maybe this can help to understand the problem. > > > > When I'm using something like this in my server Method: > > > > > > public DataTable DevolverDatosCorrida(string pCorrida, string > > pEscenario, short pIdUsuario) > > { > > MRP.EjecucionMRPDevolverDatosConfiguracionActionRequest req = > > MRPWrappers.EjecucionWrappers. > > EjecucionMRPDevolverDatosConfiguracionRequestWrapper( > > pCorrida, pEscenario); > > MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse res = > > (MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse) > > Generalidades.MBI.WrapperExecuteAction(req, pIdUsuario); > > //this is a datatable > > return res.Result.Result; > > } > > In my res.value I received this (res.JSON): > > > > "[[true,\"P1122\",\"Corrida 13/07\",new > > Date(Date.UTC(2006,6,14,14,41,2,687)),1,\"Supervisor de Summa > > \",\"Prue1 \",\"Escenario Prueba > > eje\",null,5,2,false,false,null,false,null,false,false,5,false,null,\"RF > > \"]];/*" > > > > So as you can see this is not a DataTable > > Why? > > > > Well, now I'm trying something different: > > I change my DataSet for a string type: > > > > > > public string DevolverDatosCorrida(string pCorrida, string pEscenario, > > short pIdUsuario) > > { > > MRP.EjecucionMRPDevolverDatosConfiguracionActionRequest req = > > MRPWrappers.EjecucionWrappers. > > EjecucionMRPDevolverDatosConfiguracionRequestWrapper( > > pCorrida, pEscenario); > > MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse res = > > (MRP.EjecucionMRPDevolverDatosConfiguracionActionResponse) > > Generalidades.MBI.WrapperExecuteAction(req, pIdUsuario); > > > > AjaxPro.DataTableConverter aj = new AjaxPro.DataTableConverter(); > > string ajSer = aj.Serialize(res.Result.Result); > > //this is an string > > return ajSer; > > } > > In my JS I received this in my res.value: > > "new > > Ajax.Web.DataTable( ,[[true,\"P7777\",\"12/7\",new > > Date(Date.UTC(2006,6,12,15,58,22,523)),1,\"Supervisor de Summa > > \",\"Prue1 \",\"Escenario Prueba > > eje\",null,5,2,false,false,null,false,null,false,false,5,false,null,\"RC > > \"]])" > > > > so I can use an eval() for use my DataTable > > > > dt = eval(res.value); > > > > And all is perfect, > > > > I don't know what could be happend, but when I use an old version > > 6.5.17.1 and all works fine. > > Can u help me? > > > > > > > > > > > > -- > Best regards | Schöne Grüße > Michael > > Microsoft MVP - Most Valuable Professional > Microsoft MCAD - Certified Application Developer > > http://weblogs.asp.net/mschwarz /> http://www.schwarz-interactive.de /> > Skype: callto:schwarz-interactive > MSN IM: passport > -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz /http://www.schwarz-interactive.de /Skype: callto:schwarz-interactive MSN IM: passport |
|
-- AlejandroR --
Hi Michael Sorry for the time... Here is the xml and schema files XML: <?xml version="1.0" standalone="yes"?> <EjecucionMRPDevolverDatosConfiguracionResponse xmlns=" http://tempuri.org/EjecucionMRPDevolverDatosConfiguracionResponse.xsd "><Result> <Existe>true</Existe> <Corrida_id>P1123</Corrida_id> <CorridaDescripcion>Corrida 13/07</CorridaDescripcion> <FechaCorrida>2006-07-24T19:06:33.1570000-03:00</FechaCorrida> <Usuario_id>1</Usuario_id> <UsuarioDescripcion>Supervisor de Summa </UsuarioDescripcion> <Escenario_id>Prue1 </Escenario_id> <EscenarioDescripcion>Escenario Prueba eje</EscenarioDescripcion> <HorizontePlanificacion>5</HorizontePlanificacion> <CantidadDiasPasadosAIncluir>2</CantidadDiasPasadosAIncluir> <OrdenesFirmesAtrasadasConsideradasParaDisponible>false</OrdenesFirmesAtrasadasConsideradasParaDisponible> <BarreraUnicaPlanificacionActiva>false</BarreraUnicaPlanificacionActiva> <Adelantamiento>false</Adelantamiento> <AdelantamientoSiempre>false</AdelantamientoSiempre> <AplicaMerma>false</AplicaMerma> <TamCuboTiempo>5</TamCuboTiempo> <ConDatosSimulados>false</ConDatosSimulados> <TratoArticulosIndistintos>RF </TratoArticulosIndistintos> </Result> <Plantas> <Planta_id>0001</Planta_id> </Plantas> </EjecucionMRPDevolverDatosConfiguracionResponse> XSD: <?xml version="1.0" standalone="yes"?> <xs:schema id="EjecucionMRPDevolverDatosConfiguracionResponse" targetNamespace=" http://tempuri.org/EjecucionMRPDevolverDatosConfiguracionResponse.xsd "xmlns:mstns=" http://tempuri.org/EjecucionMRPDevolverDatosConfiguracionResponse.xsd "xmlns=" http://tempuri.org/EjecucionMRPDevolverDatosConfiguracionResponse.xsd "xmlns:xs=" http://www.w3.org/2001/XMLSchema "xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified"> <xs:element name="EjecucionMRPDevolverDatosConfiguracionResponse" msdata:IsDataSet="true"> <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element name="Result"> <xs:complexType> <xs:sequence> <xs:element name="Existe" type="xs:boolean" minOccurs="0" /> <xs:element name="Corrida_id" type="xs:string" minOccurs="0" /> <xs:element name="CorridaDescripcion" type="xs:string" minOccurs="0" /> <xs:element name="FechaCorrida" type="xs:dateTime" minOccurs="0" /> <xs:element name="Usuario_id" type="xs:short" minOccurs="0" /> <xs:element name="UsuarioDescripcion" type="xs:string" minOccurs="0" /> <xs:element name="Escenario_id" type="xs:string" minOccurs="0" /> <xs:element name="EscenarioDescripcion" type="xs:string" minOccurs="0" /> <xs:element name="EsEscenarioReal" type="xs:boolean" minOccurs="0" /> <xs:element name="HorizontePlanificacion" type="xs:short" minOccurs="0" /> <xs:element name="CantidadDiasPasadosAIncluir" type="xs:short" minOccurs="0" /> <xs:element name="OrdenesFirmesAtrasadasConsideradasParaDisponible" type="xs:boolean" minOccurs="0" /> <xs:element name="BarreraUnicaPlanificacionActiva" type="xs:boolean" minOccurs="0" /> <xs:element name="BarreraPlanificacion" type="xs:short" minOccurs="0" /> <xs:element name="Adelantamiento" type="xs:boolean" minOccurs="0" /> <xs:element name="DiasAdelantamiento" type="xs:short" minOccurs="0" /> <xs:element name="AdelantamientoSiempre" type="xs:boolean" minOccurs="0" /> <xs:element name="AplicaMerma" type="xs:boolean" minOccurs="0" /> <xs:element name="TamCuboTiempo" type="xs:short" minOccurs="0" /> <xs:element name="ConDatosSimulados" type="xs:boolean" minOccurs="0" /> <xs:element name="Planta_id" type="xs:string" minOccurs="0" /> <xs:element name="TratoArticulosIndistintos" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Plantas"> <xs:complexType> <xs:sequence> <xs:element name="Planta_id" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> </xs:schema> |