刚刚接触Windows mobile,写了个简单的Sample.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;

namespace WebserviceDome
{
    
public partial class Form1 : Form
    
{
        
public DataSet authors;
       
        
public Form1()
        
{
            InitializeComponent();
        }


        
private void Form1_Load(object sender, EventArgs e)
        
{

            WebReference.Service pdaWS 
= new WebReference.Service();//调用webservice
            pdaWS.Url = "http://192.168.1.146/Pda_service/Service.asmx";//ip不要使用localhost或者是127.0.0.1

            
this.authors = pdaWS.GetAuthor();//webservice中的方法,查询Author表,返回DataSet

            
this.authorsGrid.DataSource = authors.Tables["author"];//将DataSet中的数据放到DataGird
    
        }

    }

}
posted on 2007-04-16 16:03  下风  阅读(968)  评论(1)    收藏  举报