return DataSet from webservice to PPC ???

  • Thread starter Thread starter Ofer B.
  • Start date Start date
O

Ofer B.

Hi all

I know that the PPC don't support type dataset. so I use this code in the
web service

[WebMethod]
public DataSet GetPeople()
{
sqlDataAdapter1.Fill(dsPeople1);
DataSet ds2 = dsPeople1;
return ds2;
}

The function works fine on the PC but on the PPC I get this exception:
PlatformNotSupportedException

Any suggestion???

This is the return dataset, the msdata:Locale="he-IL" , maybe this is the
reason for the exception??
if yes, how can I change it?

Thanks, Ofer

<?xml version="1.0" encoding="utf-8" ?>
- <DataSet xmlns="http://tempuri.org/">
- <xs:schema id="dsPeople"
targetNamespace="http://www.tempuri.org/dsPeople.xsd"
xmlns:mstns="http://www.tempuri.org/dsPeople.xsd"
xmlns="http://www.tempuri.org/dsPeople.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified">
- <xs:element name="dsPeople" msdata:IsDataSet="true" msdata:Locale="he-IL">
- <xs:complexType>
- <xs:choice maxOccurs="unbounded">
- <xs:element name="People">
- <xs:complexType>
- <xs:sequence>
<xs:element name="PersonID" msdata:ReadOnly="true"
msdata:AutoIncrement="true" type="xs:int" />
<xs:element name="PersonName" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
- <xs:unique name="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:People" />
<xs:field xpath="mstns:PersonID" />
</xs:unique>
</xs:element>
</xs:schema>
- <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
- <dsPeople xmlns="http://www.tempuri.org/dsPeople.xsd">
- <People diffgr:id="People1" msdata:rowOrder="0">
<PersonID>0</PersonID>
<PersonName>McAllen, Lesley</PersonName>
</People>
- <People diffgr:id="People2" msdata:rowOrder="1">
<PersonID>1</PersonID>
<PersonName>Smith, Ed</PersonName>
</People>
- <People diffgr:id="People3" msdata:rowOrder="2">
<PersonID>2</PersonID>
<PersonName>Smith, James</PersonName>
</People>
- <People diffgr:id="People4" msdata:rowOrder="3">
<PersonID>3</PersonID>
<PersonName>Williams, Mark</PersonName>
</People>
</dsPeople>
</diffgr:diffgram>
</DataSet>
 
Ofer B. said:
Hi all

I know that the PPC don't support type dataset. so I use this code in the
web service

Actually PPC suppotd DataSet just fine
[WebMethod]
public DataSet GetPeople()
{
sqlDataAdapter1.Fill(dsPeople1);
DataSet ds2 = dsPeople1;
return ds2;
}

The function works fine on the PC but on the PPC I get this exception:
PlatformNotSupportedException

This should work, but as you point out perhaps the locale is the problem.
Any suggestion???

This is the return dataset, the msdata:Locale="he-IL" , maybe this is the
reason for the exception??
if yes, how can I change it?

You change it by assigning to DataSet.Locale property
Keep in mind that if your dataset returns text in Hebrew, you will run into
some problems. Perhaps setting Locale to CultureInfo.InvariantCulture will
work
 
Alex, Thanks

The "locale" was the reason for the exception, using the method beneath
enable me to get a dataset from a web service to the PPC
Ofer
[WebMethod]

public DataSet GetPeople()

{

sqlDataAdapter1.Fill(dsPeople1);

DataSet ds2 = dsPeople1;

CultureInfo myCIinf = CultureInfo.InvariantCulture ; // the default was
"he-IL" which is not supported in the PPC

ds2.Locale = myCIinf;

return ds2;

}





Alex Feinman said:
Ofer B. said:
Hi all

I know that the PPC don't support type dataset. so I use this code in the
web service

Actually PPC suppotd DataSet just fine
[WebMethod]
public DataSet GetPeople()
{
sqlDataAdapter1.Fill(dsPeople1);
DataSet ds2 = dsPeople1;
return ds2;
}

The function works fine on the PC but on the PPC I get this exception:
PlatformNotSupportedException

This should work, but as you point out perhaps the locale is the problem.
Any suggestion???

This is the return dataset, the msdata:Locale="he-IL" , maybe this is the
reason for the exception??
if yes, how can I change it?

You change it by assigning to DataSet.Locale property
Keep in mind that if your dataset returns text in Hebrew, you will run into
some problems. Perhaps setting Locale to CultureInfo.InvariantCulture will
work
 
Back
Top