"Asp. Net 2.0 secrets" Reading Notes (16)

Source: Internet
Author: User

Create a data access component

* SystemDataSqlServerCe: SQL SERVER MOBILE EDITION;

* DataReader is recommended when obtaining data.

* SQL latency function: WAITFOR DELAY '0: 0: 03 ';

* I remember a book saying that the execution process of a function is generally less than one second;

* Sqlconnection is used as the connection buffer pool by default. The default size is 100;

* Conn. close (): instead of actually destroying the connection, it is stored in the connection pool;

* List all current user connections to the database

SQL CODE:SELECT * FROMmaster ..sysprocesses WHERE hostname<>''

* When DataReader is used, reader must be closed before reading the output parameter. Otherwise, an error occurs because reader is automatically disabled during reading;

* Database technology access efficiency (msdn article): Performance Comparison: DataAccess Techniques;

* The biggest disadvantage of CommandBehavior. CloseConnection is that it prevents users from adding any exception code;

* Executing multiple commands in one command can improve efficiency and reduce database connections;

* Reader ["ColumName"]: gets the value of this column and returns the obj type.

* When the command returns multiple result sets, use NextResult () to the next result set;

* MARS: Multiple Active Resultsets, multi-activity result set;

* The above is used to bind multiple Command objects to a connection object, but the connection string must contain "MultipleActiveResultSets = True ";

* Each request, asp.net, is allocated with a new thread in the thread pool for execution. If there is no thread available in the thread pool, new requests are placed in the queue, if the queue is too large, the server will return a 503 error for the new request, indicating that the server is too busy. When using the asynchronous data layer, the request performance can be improved, this is because when the request is not returned, the current thread will first release it back to the request thread pool, and then apply for a new thread to continue the current request;

* You can use the HttpRuntime node in the Web configuration file (Web. config) to configure the thread pool of the Asp.net program. Modify the attributes of appRequestQueueLimit, minLocalRequestFreeThreads, and minFreeThreads to control the number of requests that can be processed in the asp.net framework queue discard and output error information tab.

* When asynchronous Ado.net is used, AsynchronousProcessing = true must be added to the connection string to enable the asynchronous function of the database;

* Setting Asynchronization for the requested page can improve the above performance (

<%@ Page Async="true" AsyncTimeout="8"%>

)

* The specific example is Page 576;

* ExecuteInParallel: whether it is concurrent execution or parallel execution. The difference between the two is that parallel execution and parallel execution at the micro level;

* Replace Page. RegisterAsyncTask (): AddOnPreRenderCompleteAsync ();

* Enable CLR (runtime in general language) Integration

Database commands (query analyzer ):

Sp_configure 'clr enabled', 1

RECONFIGURE

Ignore warnings

* Use the SQL SERVER database object Page 578;

* Register or deregister a dataset and user-defined types:

Create assembley DBMovie FROM 'C: \ DBMovie. dll'

DROP Assembly DBMovie

SELECT * FROM sys. assembles \ to view all the assemblies of the current database;

Create type dbo. DBMovie external name DBMmovie. DBMovie

Drop type DBMovie

Similarly, you can customize the creation process.

It's really powerful, but I don't know the benefits of using it for the moment. It still takes time to refine it.

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: info-contact@alibabacloud.com 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.