-4

So I have this query in PostgreSQL:

SELECT * FROM "Database";

Which works great, but now I want to do a more complicated query and I have no idea how.

So how can I write this Query in C#:

SELECT * FROM "Database"; 
  • 1
    So, what's your question? – T_Bacon Dec 21 '17 at 12:18
  • -1 because I found a solution in 3sec google search. See my answer. And actually it's also a bit off-topic. – pLumo Dec 21 '17 at 12:46
  • 2
    you edited your question to be even more useless... – pLumo Dec 21 '17 at 13:13
  • 2
    @RoVo I agree with your 2.ed comment but would call it more offtopic instead of useless... However IMO your first comment isn't valid because you have more experience in this field as OP and can, therefore, google more efficient and know the words you need to use in order to get meaningful results – LaughU Dec 21 '17 at 13:22
  • 1
    On the point of searching, it also worth bearing in mind that Google personalizes search results, so what one person finds on the first page another may not find until many pages down. – nmtoken Dec 21 '17 at 13:30
4

Use this:

return @"SELECT ST_AsGeoJSON(ST_Transform(geom, 32633)) 
    FROM ""Database"" 
    WHERE ST_Distance(ST_Transform(geom, 32633),
    ST_SetSRID(ST_Point(536251.378984788,5211860.67521085), 32633)) < 100";

(This is called Verbatim string literal)

(via)

Not the answer you're looking for? Browse other questions tagged or ask your own question.