The previous connection was normal, not even on these two days. ( no patience to look at the end of the solution directly)
The error message is as follows:
1. Attempt to read or write protected memory. This usually indicates that other memory is corrupted. (System.Data)
2. The connection to the server was successfully established, but an error occurred during the login process. (Provider:ssl provider,error:0-received a message exception, or is not in the correct format.) ) (Microsoft SQL Server)
Then the management collapsed.
No way, then use the Server Explorer connection in the VS, the results can be imagined, where vs version 2008,2010,2012,2013 all crashed. No words, how to do, contact server customer service, said a half-day, no way, under a SQL server2008 client to try, did not expect to really connect on.
This is not the climax, the climax is I write code found ExecuteNonQuery () execution times the same error, what to do, the eggs are broken ... System.Data.SqlClient are not used. Anger, replaced by System.Data.OleDb, a miracle appeared, OK.
This look reminds me, and then I set up the data source provider in Server Explorer for VS:
The result should be guessed, normal.
See here you must think Tangled finally ended, wrong, SQL Server 2012 or not, ah, landing interface options do not set the data source provider where, how to do? Look at the Internet. Using management to connect to other databases, such as connecting to Oracle, you can use linked server connections to configure ODBC. The Pit Dad is ODBC is all done, the test has been successful, but here is the failure.
Not yet. From SQL Server Management Studio connection, who know to help me under, I updated to the article, I hope the back step on this pit smooth, do not waste time on it.
Long winded so much, I first give a temporary solution, followed by add:
- Using SQL Server 2008 clients
- Use System.Data.OleDb instead of System.Data.SqlClient in your program
Append:
Thanks to Hedon solution, verified that the thunderbolt caused by the exception, uninstall all the products Thunderbolt, the problem is resolved.
Doubts are also before the use of thunder, perhaps the Thunder automatically updated some components caused, remember when win8 just out, Thunder also caused IE10 collapse. The specific principle is unknown, first of all.
Thanks Jaypgcool: Maybe Thunderbolt changed some of the Winsock settings, reset the Winsock on OK, command: netsh winsock reset
vs or SQL server2012 problems connecting to SQL Server: A connection was successfully made to the server, but an error occurred during login