In the past few days, when writing a small software using winform, you need to connect to the database and use the Datagridview control. However, the following error message is displayed when you connect to the database using the [Data Source Configuration Wizard:
Image:
---------------------------
Wizard form
---------------------------
An error occurred.
Error message: Failed from assembly "Microsoft. visual Studio. dataDesign. syncDesigner. dslPackage, Version = 9.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a "load type" Microsoft. visual Studio. dataDesign. syncDesigner. syncFacade. syncManager ".
---------------------------
I found a solution from the Internet, and sorted it out after the test, hoping to help those who encountered the same problem.
Method 1: Microsoft in the C: \ Program Files \ Microsoft Visual Studio 9.0 \ Common7 \ IDE directory. visual Studio. dataDesign. syncDesigner. dslPackage. if the dll version is too old, find the new dll version on another machine to overwrite it.
Method 2: Install the VS2008SP1 patch file.
First, describe the configuration of my computer. My computer is a Windows XP sp3 system, installed with VS2008 Professional Edition, VS2010 Chinese flagship edition, and used the SQL Server 2005 database.
To test, I am running two Windows XP sp3 virtual machines,
System ① only VS2008 Professional Edition and SQL Server 2005 databases are installed;
System 2 has installed VS2008 Professional Edition, VS2010 Chinese flagship edition, and SQL Server2005 database.
Purpose: To test whether the problem is caused by simultaneous installation of VS2008 and VS2010.
Test Overview: Use VS2008 to create a Winform program in two systems, and use the Datagridview control to connect to the SQL Server2005 database and display data.
First, perform the test under system ①.
Only vs2008 and sqlserver2005are installed.
As shown in, after selecting [select your data connection] and clicking Next, the dialog box for [select database object] is displayed, then you can select tables, views, stored procedures, and functions.
As shown in, the fields in the database are displayed.
Click [run] to start the program. You can see that the database is connected smoothly.
Then perform the test under system ②:
Install vs2008, vs2010, and sqlserver2005.
Configure [select your data connection]:
After you click [next], the following error dialog box is displayed:
It can be seen that vs2008 failed to connect to the database using the Datagridview control.
Next, use vs2010 in system ② To test the same process:
Create a Winform application:
Drag the Datagridview control and connect to the database:
After successfully connecting to the database, click [next] to bring up the [select database object] window:
The running program correctly displays the database information:
To sum up, we can see that this issue is indeed related to the simultaneous installation of vs2008 and vs2010. Some files in vs2008 are affected by vs2010.
Solution:
Method 1:
Your Microsoft. VisualStudio. DataDesign. SyncDesigner. DslPackage. dll version is outdated. Find the new dll version on another machine to overwrite it.
Path: C: \ Program Files \ Microsoft Visual Studio 9.0 \ Common7 \ IDE
This method is not tested by myself, because the vs2008 installed on my computer and the virtual machine are both a version, such:
This is under system ①:
This is under system ②:
It can be seen that the creation time and size of the two files are the same.
I have also considered copying this file in vs2010, but I am worried that different versions will cause software crash and I will not test it.
One version is 9.0.21022.8, And the other version is 10.0.30319.1.
As for copying the same file from other versions of vs2008, no further tests were conducted.
Method 2:
Upgrade vs2008 and install the patch vs2008sp1.
Download and install the sp1 Patch from the Microsoft Website:
After the installation is complete, check the version of vs2008 and. net framework:
Connect to the database again. The [select database object] dialog box is displayed:
Run the program and connect to the database normally:
Appendix: vs2008sp1:
Http://www.microsoft.com/downloads/zh-cn/details.aspx? FamilyID = 27673c47-b3b5-4c67-bd99-84e525b5ce61
I refer to the following network: http://blog.csdn.net/dantengmiaomi/article/details/6857781