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 introduces the knowledge of how to achieve simple data binding and complex data binding in ADO 2.6. in the operation of practical cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
We introduced several ways to get data in XML format from the ADO recordset, and also got the most simplified string. But there are a few issues you still need to pay attention to. There are some field values in ADO 2.6 that are not supported in XML, such as: "'&, such as Procter & Gamble's name, Chef Anton's Gumbo Mix product name, etc., which need to be encoded during the conversion.
When saving a hierarchical recordset (data shapes), there are two limitations: you cannot save parameterized recordsets and recordsets that contain unresolved updates. To further improve performance, you can put the transformation work into the COM/COM+ component, and the ASP code can only do the final presentation of the data. Separate the business layer, the data layer and the presentation layer, ASP only needs to call the data component, ADO 2.6data component calls the stored procedure of the database, the result is converted into XML,*** and the simple XML character ring string back to the ASP program, ASP can use XSLT to convert XML and send the result to the browser.
The XML automatically generated by ADO contains schema information, which describes what nodes and attributes are allowed and what data types are used in this ADO 2.6, and the data nodes also add namespaces. Schema information may be useful where data validation is needed or for more complex processing, but in most cases we use thin clients and we don't need schema information. We can use XSLT to separate out the information we want and get rid of the excess information. Therefore, we write the following "DataCleaner.xsl":
SqlCommandBuilder sqlCommandBuilder1 = new SqlCommandBuilder (sqlDataAdapter1); / / initialize the SqlCommandBuilder instance dsDataSet1.Tables ["Customers"] .Rows [0] .Delete () with sqlDataAdapter1 as the parameter; / / delete the * row data sqlDataAdapter1.Update (dsDataSet1, "Customers") from the data table Customers in DataSet; / / call the Update method to update the data from the database dsDataSet1.Tables ["Customers"]. AcceptChanges () with the data in DataSet.
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 for database development, such as DbTextBox and DbLabel, are not available in .net FrameWork SDK. Data binding technology can "transform" TextBox components into DbTextBox components, ADO 2.6 "transform" Label components into DbLabel components, and so on. In the group, there are two categories. 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. ADO 2.6 there is no clear distinction between simple data binding and complex data binding.
Simple data binding:
Simple data binding generally uses the Add method of the DataBindings attribute in these components to bind a row in a DataTable in DataSet to a property of the component, so as to achieve the effect of displaying data. The specific implementation of the data binding of the TextBox component is to add the code of ADO 2.6 in listing 03 after listing 01. The code in listing 03 binds the data of "CustomerID" in the Customers data table in DataSet to the Text attribute of TextBox, so ADO 2.6 is generated. Other methods for data binding of simple data binding components are similar to this:
This is the end of how to implement simple and complex data binding in ADO 2.6. thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.