System.accessviolationexception: Attempt to read or write protected memory. This usually indicates that other memory is corrupted

Source: Internet
Author: User
Tags sql server management

Before also encountered such a problem, has not been resolved, and finally reinstall the system, finally solved.

Did not expect 1 months later, and this situation, let me crash, this decision must find out why;

After commissioning, it was found that connection. Open (); error later, System.accessviolationexception: attempt to read or write protected memory. This usually indicates that the other memory is corrupted and that a lot of web searches are not useful.

Then I found the connection to the local database was good, the connection to the remote database was an error, but it was good in SQL Server management

Then in the VS Service Explorer found the problem, found that VS2010, as long as a connection to the remote database immediately shut down, VS2008 is good, and finally found in the moment of turning off, will pop up a hint, after several times, finally found the key:

Provider Sslprovider error:0

On the Internet a search, enlightened, the solution is as follows:

1: Use OLE DB, no longer use SqlClient can be resolved;

2: This is the most convenient, enter CMD in the start run bar, and then run as Administrator: input: After netsh winsock reset, the system prompts to restart the computer, after restarting the solution!

(Windows key +r)

Finally, add the meaning of this command:

The netsh winsock reset command, which functions to reset the Winsock directory. If there is a problem with the Winsock protocol configuration on a machine that will cause problems such as network connectivity, you will need to reset the Winsock directory with the Netsh winsock reset command to restore the network. This command re-initializes the network environment to resolve parameter errors caused by software conflicts and virus causes. Netsh is an interface capable of operating almost all network-related settings via the command line, such as setting up Ip,dns, network cards, wireless networks, etc., Winsock is the internal directory of the system, Winsock is the Windows network programming interface, and Winsock works in the application layer, It provides a high-level data transfer programming interface independent of the underlying transport protocol, and reset is the reset operation to Winsock. The IP needs to be reconfigured when the command to perform Winsock restarts the computer.

System.accessviolationexception: Attempt to read or write protected memory. This usually indicates that other memory is corrupted

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.