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 Database Source
If you want to work with LINQ to PostgreSQL, you should use Entity Developer.
Create data model in it, generate the code classes in your project directory.
Then add this code file to your project, also add the required references.
These actions will let you work with DataContext specific to LINQ to PostgreSQL.
Create data model in it, generate the code classes in your project directory.
Then add this code file to your project, also add the required references.
These actions will let you work with DataContext specific to LINQ to PostgreSQL.