我已经制作了一个具有此代码的网络服务
static SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["Connection"].ToString());
[WebMethod]
public DataSet SQLBranchMaster() {
String Load = "SELECT * FROM BranchMaster";
conn.Open();
SqlDataAdapter adapt = new SqlDataAdapter(Load,conn);
DataSet ds = new DataSet();
adapt.Fill(ds);
conn.Close();
return ds;
}
现在在 Windows 窗体上我的代码是
dataGridView1 = new DataGridView();
// Service is my Webserive class name
// myservice is my reference added in the Winforms
myservice.Service test = new myservice.Service();
dataGridView1.DataSource = test.SQLBranchMaster();
现在怎么办?当我运行表单时没有显示