I am a new guy who try to develop Mobile application using C#.NET and Pocket PC Emulator.
I had developed and tested a Web Service. and it work succesfully!! Here is the code :
[WebMethod(Description = "Shows all Sales Data")]
public DataSet ReturnData()
{
String ConnectionString = "server=(local);Integrated Security=SSPI;Persist Security Info=False;uid=ekoyw;pwd=;database=Latihan";
SqlConnection SqlCon = new SqlConnection(ConnectionString);
SqlCon.Open();
SqlDataAdapter SqlDa = new SqlDataAdapter("Select * from Sales", SqlCon);
DataSet Ds = new DataSet();
SqlDa.Fill(Ds);
return Ds;
}
Then, I added this web service as Web reference on my mobile application. here is the code :
and tested on Pocket PC. but "Could not establish connection to network" appeared. I have followed the instruction to update my ActiveSync. Also tested my Web Service on Pocket PC and everything was fine!!
but the error message still appeared on
///
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://servername//xmlwebservices/ReturnData", RequestNamespace="http://servername//xmlwebservices/", ResponseNamespace="http://servername//xmlwebservices/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public System.Data.DataSet ReturnData() {
object[] results = this.Invoke("ReturnData", new object[0]);
return ((System.Data.DataSet)(results[0]));
}