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 relevant knowledge of "what is the object of ADO.NET instance". In the operation of actual cases, many people will encounter such a dilemma, so 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!
The technicians of the ADO.NET instance object are committed to Team System and provide relevant tools, which can reduce the detours and complexity of the work throughout the software development cycle. If you want to create a database similar to the ADO.NET instance object, and you want the database to be in the default location, you should change the str variable in your code.
1. Create class datasource.cs
two。 Add the SQL namespace (you can use SQL database statements): using System.Data.SqlClient
3. Declare objects in the class: (string) ConnString connection string, (SqlConnection) SqlConn ADO.NET instance object, (SqlCommand) SqlCmd call SQL statement, (SqlDataAdapter) SqlAdapter connection SQL data adapter, (DataSet) ds create dataset, (SqlDataReader) SqlReader read the database.
4. Initialize the instance object in the constructor:
Public datasource () {ConnString = ConfigurationManager.ConnectionStrings ["some data source"] .ConnectionString; SqlConn = new SqlConnection (ConnString); SqlCmd = new SqlCommand (); SqlAdpter = new SqlDataAdapter (); ds = new DataSet ();}
5. Methods of creating some datasets and database SQL operations
Create an in-memory dataset and return a read-only lightweight data source using the passed ADO.NET instance object statement parameters. Note that it does not support paging on the server side, and the data connection must always be opened to create a new data source for GridView: object-> business object datasource- > select\ delete\ update\ insert call method of related object-> set parameter sql query statement, such as select * from abc.
This is the end of the content of "what is the ADO.NET instance object". 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.