In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you "how to use VB.NET to create three-tier applications", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use VB.NET to create three-tier applications" this article.
After a long time of learning ASP.NETWeb, so share with you, after reading this article, you must have a lot of gains. I hope this article can teach you more. When learning ASP.NETWeb, you may encounter related problems, here will introduce the solution to the ASP.NETWeb problem.
The structure is divided into three layers: presentation layer, business layer and data layer. Data layer: represents the physical database. Business layer: responsible for data transmission between the data layer and the presentation layer. Presentation layer: the client of an application that accesses the database through the business layer.
The presentation layer operates on the local data that resides in memory, and when the database data needs to be updated, it is achieved through the update method provided by the business layer. This can greatly improve the performance of the application, and it is entirely up to you to decide when to update the data, which increases the flexibility of programming.
Example:
Here we do an example to see how to use VB.NET to create a three-tier application.
Database: we chose SQLSERVER's NorthWind database. Business tier: we create a WebService as the middle tier. (need to install IIS service) presentation layer: ASP.NETWeb Let's write a WindowsForm*** step: create a WebService.
The specific steps are as follows:
1. Create a new project, select the ASP.NETWeb service, and name it "WebServiceFor Business layer".
two。 Add two SqlDataAdapter, one is Customer_da, which points to the Customers table of the NorthWind database, the other is Order_da, and the other points to the Orders table of the Northwind database.
3. Then generate a TypedDataSet (choose generate dataset from the data menu) and name it: Super_ds.
4. The database connection is complete, and next we will consider the communication between it and the presentation layer, here we define two methods. One is Get_DataSet, which returns a dataset of type Super_ds, and the other is Update_DataSet, which is responsible for updating database data. The method code is as follows:
ImportsSystem.Web.Services PublicClassService1 InheritsSystem.Web.Services.WebService 'WebServicesDesignerGeneratedCode. . PublicFunctionGet_Dataset () Assuper_ds customer_da.Fill (Super_ds1.Customers) order_da.Fill (Super_ds1.Orders) ReturnSuper_ds1 EndFunction PublicSubUpdate_Dataset () Super_ds1.AcceptChanges () EndSub WEBSERVICEEXAMPLE TheHelloWorld () exampleservicereturnsthestringHelloWorld. Tobuild,uncommentthefollowinglinesthensaveandbuildtheproject. Totestthiswebservice,ensurethatthe.asmxfileisthestartpage andpressF5. PublicFunctionHelloWorld () AsString elloWorld= "HelloWorld" EndFunction EndClass is all the content of this article "how to create a three-tier application with VB.NET". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un