程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> .NET網頁編程 >> ASP.NET >> ASP.NET基礎 >> asp.net 使用Silverlight操作ASPNETDB數據庫

asp.net 使用Silverlight操作ASPNETDB數據庫

編輯:ASP.NET基礎
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","[email protected]","q","a");
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved