Jonathan Burgos G.
Jonathan Burgos G.

Reputation: 344

How to make a connection to the postgresql database separated by schema?

I am trying to connect to the postgresql database and everything works fine, but I do not know how to make a query to fetch data from a table that is in a schema, but it can help me. When I consult by PgAdmin the queries I make are this: SELECT * FROM "public"."STORE";

But in the C # code I can not do this query with double quotation marks and no single quotes, someone knows like the previous query by code.

Upvotes: 2

Views: 833

Answers (1)

JGH
JGH

Reputation: 17906

You need to escape the double quote.

string query = "SELECT * FROM \"public\".\"STORE\";";

or

string query = @"SELECT * FROM ""public"".""STORE"";";

You can get more info on MSDN

Upvotes: 1

Related Questions