I'm using LINQ to SQL (PostgreSQL) via DbLINQ.
I have a problem doing LINQ to PostgreSQL. I succesfully generated .dbml and .cs files with dbmetal and I think I got all the references, the code compiles. Refs:
DbLinq
DbLinq.PostgreSql
DbLinq.SqlServer
Npgsql
using DbLinq.PostgreSql;
I get an exception:
{"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)"}
inner exception:
{"The system cannot find the path specified"}
connection string:
server=127.0.0.1;database=xxxxx;user id=postgres;password=xxxxx;
ili
server=localhost;database=xxxxx;user id=postgres;password=xxxxx;
If I try to use NpgsqlConnectionStringBuilder I get:
HOST=localhost;PORT=5432;PROTOCOL=3;DATABASE=xxxxx;USER ID=postgres;PASSWORD=xxxxx;SSL=False;SSLMODE=Disable;TIMEOUT=15;SEARCHPATH=;POOLING=True;CONNECTIONLIFETIME=15;MINPOOLSIZE=1;MAXPOOLSIZE=20;SYNCNOTIFICATION=False;COMMANDTIMEOUT=20;ENLIST=False;PRELOADREADER=False;USEEXTENDEDTYPES=False;INTEGRATED SECURITY=False;COMPATIBLE=2.0.12.0;APPLICATIONNAME=
with an exception {"Keyword not supported: 'host'."}
I connect succesfully over SquirrelSQL and jdbc driver on Win7 64-bit, Postgres 9.2 64-bit
Edit: this is fine
xxxxxDC dc = new xxxxxDC("server=127.0.0.1;database=xxxxx;user id=postgres;password=xxxxx;DbLinqProvider=PostgreSql;");
var q = from r in dc.xxxxx
select r;
but i get an error on
dataGridView1.DataSource = q
Now i know this is because the query is not executed immediately. But the problem remains. "The server was not found or was not accessible"
F1!
lp