내 프로젝트는 잘 작동하지만, 컴퓨터 B에 나는 SQL 예외를 얻을 :VS2012 C# SQL 데이터베이스 오류 - 잘못 설치 되었습니까? 컴퓨터 A에
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)
나는 CreateDatabse()
방법 (DataContext
클래스에서 상속 Database
클래스)를 호출 할 때마다.
이미 전체 SQL Server를 다시 설치하려고했지만 예외는 남아있었습니다. SQL Server 2012가 설치되어 있습니다. 내 SQL 관련 프로그램의 목록이 설치 :
그것은 어떤 차이가있는 경우
, 컴퓨터 A는 WIN7에 win8 컴퓨터 B에서 노력하고 있습니다.데이터베이스는 프로그램 코드에 의해 생성됩니다
String FOLDER_PATH = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "ProgramName");
Directory.CreateDirectory(FOLDER_PATH);
String path = Path.Combine(FOLDER_PATH, "database.mdf");
Database db = new Database(path);
bool exists = db.DatabaseExists();
if (exists == false)
db.CreateDatabase();
public class Database : DataContext
{
public Table<Record> RecordTable;
public Database(string connection) : base(connection) { }
}
편집 : 내 문제가 여전히 미해결이다. MS SQL을 한 번 더 다시 설치하려고했지만 효과가 없습니다. 연결 문자열이 제대로 구성되어 있지 않거나 컴퓨터 A에 방화벽이 SQLServer에 네트워크에서 잘 작동하는 것을 방지 할 때
당신이 컴퓨터 B의 실제 * 데이터베이스 *이 있습니까 ... 발생? – Thousand
@Thousand - 해당 데이터는 프로그램별로 작성됩니다. 이 코드를 원래 게시물에 추가하겠습니다. –
연결 문자열을 여기에 입력 할 수 있습니까? –