Document directory
- Previous issues:
- This article briefly introduces
Previous issues:
In terms of database usage, egmkang and ruixuenian have given a lot of suggestions. I have also tested the use of SQLite. In terms of SQL Server CE query, the egmkang performance test code has also been run. Thank you for your help.
This article briefly introduces
In addition to data interaction with the local SQL Server CE, windows mobile applications can also communicate with remote WebServices. This process is basically similar to winform development, we can first create a solution, including a windows mobile Application project and a web site, where the web site only needs to add a webservice page. Here, the default page is used, this service has only one default internal method Helloworld. When the windows mobile Application calls this method, it can receive hello, world!
Step 1 create a webservice and a windows mobile Application
There is only one simple method helloworld () in werservice ();
Step 2: Add a web reference to the windows mobile Application. The default reference name is
After adding a reference, add a button on the default Form1 to trigger a webservice event. You can add the following call code in the Click Event of the button:
Private void button#click (object sender, EventArgs e)
{
Localhost. Service ws = new SmartDeviceProject1.localhost. Service ();
MessageBox. Show ("Message From webservice:" + ws. HelloWorld ());
}
In this way, the test is completed, but there is a problem here, that is, the code in webcast is found when searching for materials, and the webservice address is not:
Http: /localhost: 4534/WebSite2/WebService. asmx
But:
Http: /wengyuli: 4534/WebSite2/WebService. asmx
That is to say, this webservice address uses the PC name, not localhost, But I have tested both of them, but both of them fail to be called. Please let me know. Thank you.
Solution:
If the network card is bound to the original, if all are set by default, the simulator IP address is the same as the host IP address, so you only need to replace the simulator IP address. Of course, you can also access it by using the machine name, such as http: // wengyuli/website1/webservice. asmx, but cannot be accessed through localhost.