Close access to ASP. Net (6)

Source: Internet
Author: User

Use of Namespace
In the previous program, we can see that I often use <% @ Import Namespace = "System. Data" %>.
Use the Namespace provided by M $ for us. This is different from ASP. We must first reference the Namespace provided by our operations in
The corresponding functions can be used only after the Namespace is disabled. To put it bluntly, a Namespace is a component.
This is an advanced application of I will talk about it in a later chapter. (But write it there, time ......
Below I will briefly list some commonly used namespaces
<% @ Import Namespace = "System. Data" %> used to process Data
<% @ Import Namespace = "System. Data. ADO" %> used when using;
<% @ Import Namespace = "System. Data. SQL" %> dedicated to SQL Server databases
<% @ Import Namespace = "System. Data. XML" %> you do not need to view
<% @ Import Namespace = "System. IO" %> used for File Processing
<% @ Import Namespace = "System. Web. Util" %>
<% @ Import Namespace = "System. Text" %> used for Text Encoding
What database operations require
After explaining the Namespace, we can officially discuss database applications. From the above we can see that we operate
Database, We need to reference the following two namespaces
<% @ Import Namespace = "System. Data" %>
<% @ Import Namespace = "System. Data. SQL" %>
In fact, System. Data. SQL can be replaced by System. Data. ADO. SQL is dedicated to SQL Server and ADO can
Support any database (as long as there is a corresponding driver on the host, such as Access, Mysql, Oracle, and so on)
Because the Apsara stack database is SQL Server, you can use ADO.
Come on, why not. As for the benefits it can bring, the flying knife has not been tested, and the SQL Server must be better than the ADO
Both ADO and SQL have several basic objects for operations.
Connections is linked to a database to facilitate subsequent applications (similar to Connections in ADO)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.