DataContext Database Source
Posted: Tue 09 Dec 2008 14:52
I create DataContext using the same connection string that works for PgSqlConnection:
DataContext dataContext = new DataContext("DATABASE=***;USER ID=***;PASSWORD=***;SERVER=localhost");
However, here I get (later, when executing a query) an error message:
"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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
I assume the this is because DataContext doesn't know that I do not want to open a connection for MS SQL Server but for PostreSQL. How can I select database source for DataContext?[/b]
DataContext dataContext = new DataContext("DATABASE=***;USER ID=***;PASSWORD=***;SERVER=localhost");
However, here I get (later, when executing a query) an error message:
"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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
I assume the this is because DataContext doesn't know that I do not want to open a connection for MS SQL Server but for PostreSQL. How can I select database source for DataContext?[/b]