简体   繁体   中英

Problem connecting VWD Express 2008 to SQL Server Express 2005

WHen i try to connect to SQL Express 2005 from Visual Web Developer Express 2008, i was getting errors like 'Could not load file or assembly Microsoft.SqlServer.Management.Sdk.Sfc' .

I read some posts which advised me to download and install 3 applications to address above issue ( SharedManagementObjects.msi, sqlncli.msi,SQLSysClrTypes.msi ).

I did that and now i get a different connection error

'A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) '.

Does anyone know a way of overcoming this ?

Thanks.

How are you trying to connect ? Just a regular ADO.NET connection? If so, what's your connection string?

Are you trying to use SMO (SQL Mgmt Objects)? This sounds like some of your SMO objects aren't available for some reason - you might want to download and reinstall those SMO components from here . The files you want are quite a bit down the page, under the heading of " Microsoft SQL Server 2005 Management Objects Collection " - files are called "SQLServer2005_XMO.msi" (with some x64 variations).

Does installing that MSI help at all?

Marc

PS: okay, thanks, based on your comment - can you try this connection string here:

string connectionString = @"Server=.\SQLEXPRESS2005;Database=DBName;Integrated Security=SSPI";

如果您在本地运行SQL Sever Express,则可能需要在服务控制台中进行检查(WinKey,Run,“ services.msc”),并验证您是否具有SQL Server和SQL Server Agent条目并且它们都在运行。

I think this problem is certainly with your connection string. Try doing this

  1. Run the SQL Management Express, and get the server instance name from it.

Usually this problem occurs when the server instance name is wrong (on many computers it could be SQLEXPRESS).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM