服务器之家:专注于服务器技术及软件下载分享
分类导航

PHP教程|ASP.NET教程|Java教程|ASP教程|编程技术|正则表达式|C/C++|IOS|C#|Swift|Android|VB|R语言|JavaScript|易语言|vb.net|

服务器之家 - 编程语言 - ASP.NET教程 - asp.net 使用Silverlight操作ASPNETDB数据库

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

2019-07-04 14:26服务器之家 ASP.NET教程

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

延伸 · 阅读

精彩推荐