当前位置:Gxlcms > asp.net > asp.net 使用Silverlight操作ASPNETDB数据库

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

时间:2021-07-01 10:21:17 帮助过:29人阅读

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");

人气教程排行