[求助]silverlight如何调用webservice多次查询数据库?? 200
publicPage_Layout(Listlist_Can)//Listlist_Ell{InitializeComponent();get_DATA("aaa");/...
public Page_Layout(List list_Can)//List list_Ell
{
InitializeComponent();
get_DATA("aaa");//第一次调用
get_DATA("bbb");//我想再调用一次,但是获取不到数据,只得到一次的运行数据
}
private void get_DATA(string jh)
{
ServiceReference_data.Service1SoapClient userService = new ServiceReference_data.Service1SoapClient();
userService.Get_DAA05Completed += new EventHandler(get_d);
string s = "select * from table_name where jh="' + jh + '";
userService.Get_DAA05Async(s);
}
void get_d(object sender, ServiceReference_data.Get_DAA05CompletedEventArgs e)
{
if (e.Error == null)
{
for (int i = 0; i < e.Result.Count; i++)
{
CModel Ds_Model = new CModel ();
data.YCZMC = e.Result[i];
i++;
data.XCH = e.Result[i];
list_ds.Add(Ds_Model);
}
}
}
我想多次调用webservice访问数据库,请高手帮忙指点一下,谢谢! 展开
{
InitializeComponent();
get_DATA("aaa");//第一次调用
get_DATA("bbb");//我想再调用一次,但是获取不到数据,只得到一次的运行数据
}
private void get_DATA(string jh)
{
ServiceReference_data.Service1SoapClient userService = new ServiceReference_data.Service1SoapClient();
userService.Get_DAA05Completed += new EventHandler(get_d);
string s = "select * from table_name where jh="' + jh + '";
userService.Get_DAA05Async(s);
}
void get_d(object sender, ServiceReference_data.Get_DAA05CompletedEventArgs e)
{
if (e.Error == null)
{
for (int i = 0; i < e.Result.Count; i++)
{
CModel Ds_Model = new CModel ();
data.YCZMC = e.Result[i];
i++;
data.XCH = e.Result[i];
list_ds.Add(Ds_Model);
}
}
}
我想多次调用webservice访问数据库,请高手帮忙指点一下,谢谢! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询