当前位置: 萬仟网 > IT编程>开发语言>.net > asp.net 使用Silverlight操作ASPNETDB数据库

asp.net 使用Silverlight操作ASPNETDB数据库

2017年12月12日  | 萬仟网IT编程  | 我要评论
1.在server端添加silverlight-enabled wcf service 复制代码 代码如下:[servicecontract(namespace = "")
1.在server端添加silverlight-enabled wcf service
复制代码 代码如下:

[servicecontract(namespace = "")]
[aspnetcompatibilityrequirements(requirementsmode = aspnetcompatibilityrequirementsmode.allowed)]
public class service1
{
[operationcontract]
public void dowork(string name,string pwd,string email,string question,string answer)
{
membershipcreatestatus status;
membership.createuser(name, pwd,email,question,answer,true,out status);
}

// add more operations here and mark them with [operationcontract]
}

2. 添加此service 引用到silverlight
复制代码 代码如下:

servicereference2.service1client client = new servicereference2.service1client();
client.doworkasync("xxifusi", "xxifusi345","d22@we.com","q","a");

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
Copyright © 2017-2021  萬仟网 保留所有权利. 粤ICP备17035492号-1
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com