简体   繁体   中英

Reading content from MS Access db using ADO.net and trying to insert the values into a SQL Server table

I'm using an OleDb connection to read a table in MS Access. I've closed the connection and I'm trying to insert the values retrieved into a SQL Server table using Entity Framework.

While establishing the connection to SQL Server, I'm getting an 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)

The error message is crystal clear: the server was not found. So, take this two steps.

  1. Verify your connection string for misspelled server name.

  2. Verify your SQL Server instance is accepting connections from network, what is disable by default.

Go to:

Start > All Programs > SQL Server 2005 > Configuration Tools > SQL Server Surface Area Configuration

  • Click on Surface Area Configuration for Services and Connections

  • Select the instance that is having a problem > Database Engine > Remote Connections

  • Enable local and remote connections

  • Restart instance

See this article:

http://www.sswug.org/articlesection/default.aspx?TargetID=44331

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