asp.net 使用Silverlight操作ASPNETDB数据库
更新时间:2010年01月15日 17:57:12 作者:
asp.net下使用Silverlight操作ASPNETDB数据库的实现代码
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");
复制代码 代码如下:
[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");
相关文章
.NET下文本相似度算法余弦定理和SimHash浅析及应用实例分析
这篇文章主要介绍了.NET下文本相似度算法余弦定理和SimHash浅析及应用,实例形式详细讲述了相似度算法余弦定理和SimHash的原理与用法,需要的朋友可以参考下2015-01-01AspNetPager分页控件源代码(Version 4.2)
AspNetPager分页控件源代码(Version 4.2)...2007-04-04
最新评论