自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

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

開(kāi)發(fā) 后端
這里介紹VB.NET創(chuàng)建WebService,新建一個(gè)項(xiàng)目,選擇ASP.NET Web服務(wù),命名為:“WebService For 業(yè)務(wù)層”。

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 

【編輯推薦】

  1. 講述VB.NET GroupBox控件屬性
  2. 概括VB.NET DomainUpDown控件
  3. VB.NET編碼算法學(xué)習(xí)筆記
  4. 詳細(xì)分析VB.NET讀寫文本文件
  5. 簡(jiǎn)單概括VB.NET數(shù)據(jù)綁定
責(zé)任編輯:佚名 來(lái)源: IT168
相關(guān)推薦

2009-10-14 10:19:57

VB.NET Doma

2009-10-15 17:50:48

VB.NET Spli

2009-10-26 15:57:07

VB.NET使用Ora

2009-10-13 14:50:59

VB.NET Envi

2009-10-14 16:46:25

VB.NET OnSt

2009-10-21 10:05:30

VB.NET運(yùn)行環(huán)境

2009-10-23 14:06:07

VB.NET類對(duì)象

2009-10-27 11:32:42

VB.NET Disp

2009-11-03 10:51:33

VB.NET共享

2009-10-14 13:15:09

VB.NET數(shù)據(jù)綁定

2009-11-03 10:00:20

VB.NET New方

2009-10-14 15:34:29

VB.NET窗體編程模

2009-10-28 10:51:32

VB.NET默認(rèn)屬性

2009-11-02 17:49:05

VB.NET抽象類

2009-10-29 16:23:42

VB.NET實(shí)現(xiàn)IEn

2009-11-02 09:21:04

VB.NET文件系統(tǒng)

2009-10-28 14:44:43

VB.NET Name

2009-11-02 16:41:55

VB.NET串行化對(duì)象

2009-10-15 17:33:45

VB.NET日期類型

2009-10-30 10:19:43

VB.NET OBEX
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)