asp.net Silverlight asp.net 使用Silverlight操作ASPNETDB数据库
人气:0想了解asp.net 使用Silverlight操作ASPNETDB数据库的相关内容吗,在本文为您仔细讲解asp.net Silverlight的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:asp.net,Silverlight,下面大家一起来学习吧。
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");
加载全部内容