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.