postgresql with c++ or c#

I want to display some 3d objects in the graphics window from the database postgresql ...... The data about the objects are stored in the database postgresql.......
1,is it possible to connect c++ and postgresql..... ? ( Give the  source code for connection)
2, is it also possible to connect Csharp and postgresql?... or we have to use (windows presentation Foundation) WPF in C# to connect postgresql......( Give the source code for connection)
please give me proper answers.... Awaiting for the replies.......
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

'libpqxx' is the official C++ client API for PostgreSQL, check out the downloads and documentation at

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial


From C# you can connect to postgresql using npgsql:
A lot of examples you can find here:

There are also commercial solutions:
It has integration with Visual Studio.

jsbsudhaAuthor Commented:
Csharp using CSGL  program error
earth man2Commented:
It is easy to write database stuff in C and then call that from C++.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.