First demo of mobile 5.0 pocket PC

Source: Internet
Author: User

Yesterday, the company decided to use the Device Application in the mobile 5.0 pocket PC for the next project. I turned to learn this again. OWCC must be stopped temporarily.
After completing a reconnaissance game with colleagues in the evening, we started the first mobile 5.0 pocket PC demo. But I did not study it. The content is simple. Drag a button, TextBox, and DataGrid on the page. Click the button to display the data from the database to the DataGrid through webservice. I checked other information online. It is worth noting that the address When referencing webservice cannot be localhost but should be its own ip address, but I can reference webservice through its own ip address, but an error occurs during running. Runtime error: storage memory is critically low. if you do mot increase storage memory, you may not be able to start some programs. use File Explorer to delete files you no longer need, or move some files to a storage card.
It cannot be called again. If you don't want to adjust it, let's go to consult senior personnel today. Then, it's now today. Early in the morning, I came to serve as a "recorder ".
Paste the code first.

Main Code in form:

Private void button#click (object sender, EventArgs e)
{

Service1 ser = new Service1 ();
TextBox1.Text = ser. HelloWorld (). ToString ();
DataSet ds = new DataSet ();
Ds = ser. gettable ();
This. dataGrid1.DataSource = ds. Tables ["UserInfo"];

}
Webservice:

[WebMethod]
Public string HelloWorld ()
{
Return "Hello World ";
}
[WebMethod]
Public DataSet gettable ()
{
SqlConnection conn = new System. Data. SqlClient. SqlConnection ("Data Source = YIYISAWA \ SQLEXPRESS; Initial Catalog = pubs; Integrated Security = True ");
SqlCommand cmd = new SqlCommand ("select * from UserInfo", conn );
SqlDataAdapter da = new SqlDataAdapter ();
Da. SelectCommand = cmd;
DataSet ds = new DataSet ();

Da. Fill (ds, "UserInfo ");
Return ds;
}
An error occurred while running.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.