av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

概括VB.NET創(chuàng)建WebService

VB.NET還是比較常用的,于是我研究了一下VB.NET創(chuàng)建WebService,在這里拿出來(lái)和大家分享一下,希望對(duì)大家有用。

VB.NET創(chuàng)建WebService.

具體步驟如下:

1. 新建一個(gè)項(xiàng)目,選擇ASP.NET Web服務(wù),命名為:“WebService For 業(yè)務(wù)層”。

2. 添加兩個(gè)Sql DataAdapter,一個(gè)為Customer_da,它指向NorthWind數(shù)據(jù)庫(kù)的Customers表,另一個(gè)為Order_da,指向Northwind數(shù)據(jù)庫(kù)的Orders表。

3. 然后生成一個(gè)Typed DataSet(選擇“數(shù)據(jù)”菜單的“生成數(shù)據(jù)集”),命名為:Super_ds.

4. 數(shù)據(jù)庫(kù)連接已經(jīng)完成,下一步我們將考慮它與表示層之間的通信,這里我們定義兩個(gè)方法。一個(gè)為:Get_DataSet,它返回一個(gè)Super_ds類型的數(shù)據(jù)集,另一個(gè)為:Update_DataSet,它負(fù)責(zé)更新數(shù)據(jù)庫(kù)數(shù)據(jù), 方法代碼如下:

 
 
 
  1. Public Function Get_Dataset() As super_ds  
  2. customer_da.Fill(Super_ds1.Customers)  
  3. order_da.Fill(Super_ds1.Orders)  
  4. Return Super_ds1  
  5. End Function  
  6.  
  7. Public Sub Update_Dataset()  
  8. Super_ds1.AcceptChanges()  
  9. End Sub  

你可以運(yùn)行測(cè)試一下你的VB.NET建立WebService,它將提供兩個(gè)方法。返回的DataSet是以XML表示的。

業(yè)務(wù)層的完整代碼如下:

 
 
 
  1. Imports System.Web.Services  
  2. Public Class Service1  
  3. Inherits System.Web.Services.WebService  
  4. 'Web Services Designer Generated Code……。  
  5.   Public Function Get_Dataset() As super_ds  
  6. customer_da.Fill(Super_ds1.Customers)  
  7. order_da.Fill(Super_ds1.Orders)  
  8. Return Super_ds1  
  9. End Function 
  10.   Public Sub Update_Dataset()  
  11. Super_ds1.AcceptChanges()  
  12. End Sub 
  13. ' WEB SERVICE EXAMPLE  
  14. ' The HelloWorld() example service returns the string Hello World.  
  15. ' To build, uncomment the following lines then save and build the project.  
  16. ' To test this web service, ensure that the .asmx file is the start page  
  17. ' and press F5.  
  18. '  
  19. '  Public Function HelloWorld() As String  
  20. ' HelloWorld = "Hello World"  
  21. ' End Function  
  22. End Class 

分享標(biāo)題:概括VB.NET創(chuàng)建WebService
文章分享:http://uogjgqi.cn/article/ccieehg.html
掃二維碼與項(xiàng)目經(jīng)理溝通

我們?cè)谖⑿派?4小時(shí)期待你的聲音

解答本文疑問/技術(shù)咨詢/運(yùn)營(yíng)咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流