网络编程
位置:首页>> 网络编程>> 数据库>> asp.net 使用Silverlight操作ASPNETDB数据库

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

  发布时间:2024-01-20 15:50:24 

标签: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");
0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com