【发布时间】:2012-03-27 15:15:28
【问题描述】:
我是 WCF 的新手。我做了一个如下的应用程序
我的服务如下
void IService1.getAllEmpName()
{
SqlConnection con = new SqlConnection("Data Source=SYSTEM19\\SQLEXPRESS;Initial Catalog=Dora;Integrated Security=True");
SqlCommand cmd = new SqlCommand("Select *from Users", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
}
我的界面如下
[ServiceContract]
public interface IService1
{
[OperationContract]
void getAllEmpName();
[OperationContract]
void editEmployee();
}
在我的网页中,我正在执行以下操作
private void get_categories()
{
ServiceReference1.Service1Client ws = new ServiceReference1.Service1Client();
GridView1.DataSource = ws.getAllEmpName();
GridView1.DataBind();
}
我遇到了错误,Cannot convert method group 'getAllEmpName' to non-delegate type 'object'. Did you intend to invoke the method? 任何人都可以帮忙
【问题讨论】:
标签: wcf gridview datatable dataset