In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article focuses on "what are the ADO.NET component skills", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what ADO.NET component skills are.
The code in the example assumes that you can connect to the Northwind sample database on Microsoft SQL Server version 7.0 or later. The SqlConnection is opened within the using block, which ensures that resources are closed and released when the code exits. The sample code uses SqlDataReader to execute the command and displays the results in the ADO.NET component window.
OptionExplicitOn OptionStrictOn ImportsSystem ImportsSystem.Data ImportsSystem.Data.SqlClient PublicClassProgram PublicSharedSubMain () DimconnectionStringAsString=GetConnectionString () DimqueryStringAsString=_ "SELECTCategoryID,CategoryNameFROMdbo.Categories;" UsingconnectionAsNewSqlConnection (connectionString) DimcommandAsSqlCommand=connection.CreateCommand () command.CommandText=queryString Try connection.Open () DimdataReaderAsSqlDataReader=_ command.ExecuteReader () DoWhiledataReader.Read () Console.WriteLine (vbTab& "{0}" & vbTab& "{1}", _ dataReader (0), dataReader (1) Loop dataReader.Close () CatchexAsException Console.WriteLine (ex.Message) EndTry EndUsing EndSub PrivateSharedFunctionGetConnectionString () AsString 'Toavoidstoringtheconnectionstringinyourcode,' youcanretrieveitfromaconfigurationfile. Return "DataSource= (local); InitialCatalog=Northwind;" _ & "IntegratedSecurity=SSPI;" EndFunction EndClass
Data binding is the most frequently used and most important technology in data binding technology, and it can also be said to be one of the basic knowledge that various .net development languages need to master to develop database applications. Data binding is important because the components related to database development are not provided in .net FrameWork SDK, that is, common components such as ADO.NET components, DbLabel and other common components for database development are not available in .net FrameWork SDK. Data binding technology can "transform" TextBox components into DbTextBox components, Label components into DbLabel components, and so on. All of these are directly related to DataSet.
Data binding is divided into two categories: simple data binding and complex data binding. The components suitable for simple data binding are generally Lable, TextBox, etc., and the components suitable for complex data binding are DataGrid, ListBox, ComboBox and so on. In fact, there is no clear distinction between simple data binding and complex data binding, but when components are data binding, some components with more complex structure have similar operation steps at data binding time, while other components with simpler structure are similar in data binding. As a result, there are two categories.
At this point, I believe you have a deeper understanding of "what are the ADO.NET component skills?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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
© 2024 shulou.com SLNews company. All rights reserved.