Error PlatformNotSupportedException

T

ton

When i call web service from smart device application (c#),
It display error PlatfomrNotSupportedException.
My web service return data set.
But i call this web service from window application , It work fine.

Code example web service is below.
[WebMethod]

public DataSet RetrieveHospital()

{

string strQuery = "SELECT * FROM Hospital";

SqlConnection conn = new SqlConnection(_connectionString);

SqlDataAdapter da;

DataSet ds;

da = new SqlDataAdapter(strQuery,conn);

ds = new DataSet( );

da.Fill(ds);


conn.Close();

conn.Dispose();

conn=null;

return ds;

}


Code example of Smart Device Application (C#) is below.
DataSet ds;

_10._0._0._1.Service1 serv1=new SSI._10._0._0._1.Service1();

try

{

ds=serv1.RetrieveHospital(); <- It error on this line

}

catch (System.Web.Services.Protocols.SoapException ex)

{

MessageBox.Show(ex.Message,"Error");

}



Help me please

Thanks in advance
 
I

Ilya Tumanov [MS]

This error usually means you're trying to use locale, which is not
supported by hardware.
For example, attempt to use DataSet with Hebrew locale on US device would
result in this exception.
The locale of the DataSet, returned by Web Service will be set to the
server's default locale.

Solutions:

1. Change DataSet's locale on the server to locale supported by your device:

ds = new DataSet( );
ds.Locale = new CultureInfo ("EN");

2. Change thread locale on the server to locale supported by your device:

public DataSet RetrieveHospital()
{
Thread.CurrentThread.CurrentCulture = new CultureInfo ("EN");


3. Use localized device which supports your server's locale.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top