In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what is the ADO.NET database installation creation command". In the daily operation, I believe that many people have doubts about what the ADO.NET database installation creation command is. The editor consulted all kinds of information and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the doubt of "what is the ADO.NET database installation creation command?" Next, please follow the editor to study!
It is used to construct Sql commands, for example, if you need a Update to update the database, it will be constructed for us. So how does the Sql command constructor generate the Sql statement commands we need? How does it know what we want? In fact, it doesn't know that we gave it a hint, but it is so smart that people can infer our needs from such a hint in the ADO.NET database. So where did we give a hint.
Look at this sentence myAda.SelectCommand = myCmd; we give the Sql command of the query, give the SelectCommand of the DataAdaper data adapter, and we throw the DataAdaper data adapter (in this case, myAda) to SqlCommandBuilder as a parameter, which is great, caught by SqlCommandBuilder, it is so easy and happy, according to the captured DataAdaper SelectCommand information, other Sql operation commands are generated. A friend may have asked, "can I not use this command constructor to generate Sql operation commands?" Of course, if the ADO.NET database always feels that its automatic creation does not meet our requirements, we can write it flexibly, such as the following:
MyAda.DeleteCommand = New SqlCommand ("delete * from UserInfo where.")
After the above toss, everything is ready, our data adapter can use its own sharp weapon SqlCommand to operate on the database; and so on, there is a problem, the names of the fields in our data table are all in English, then the program runs in default English, as a respectable Chinese, this is unforgivable, and the ADO.NET database has our square words that are pleasing to the eye. It doesn't matter, look at the following code:
MyAda.TableMappings.Add ("UserInfo", "UserInfo"); myAda.TableMappings [0] .ColumnMappings.Add ("UserID", "user"); myAda.TableMappings [0] .ColumnMappings.Add ("UserName", "user name"); myAda.TableMappings [0] .ColumnMappings.Add ("UserAge", "age"); myAda.TableMappings [0] .ColumnMappings.add ("UserSex", "gender") MyAda.TableMappings [0] .ColumnMappings.add ("UserAddress", "address"); at this point, the study on "what is the ADO.NET database installation creation command" is over, hoping to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.