C # After the database is restored, an error occurs: Transport-level error has occurred when sending the request to the server.

Source: Internet
Author: User
When the database is restored and other operations are continued, the system runs an error: Transport-level error has occurred when sending the request to the server.

This is usually because SQL Server encounters some issues and has to refresh all the connections, but ado.net still thinks these connections are valid. In fact, they may be used in the process, some connections have long expired.

It seems that the problem lies in the SQL connection, and the expired connection affects normal refresh. Knowing the root cause of the problem, solving it is no problem.

After the database is restored, call the clearpoool method of the connection object to clear the connection pool that is invalid. You can also call sqlconnection. clearallpools () to clear all connection pools.

The problem is solved in this way.

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: 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.