首页 > Web开发 > 详细

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

时间:2016-02-08 00:43:45      阅读:198      评论:0      收藏:0      [点我收藏+]
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");

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

原文:http://www.jb51.net/article/21842.htm

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!