troubleshooting Question

how to parse response out of postgresql ? how to better use npgsql.

Avatar of Erwin Pombett
Erwin PombettFlag for Switzerland asked on
.NET ProgrammingPostgreSQL
14 Comments1 Solution1548 ViewsLast Modified:
hello experts,

i'm using postgresql function to get data to a .NET application.
so far i succeed to accumulate my datas in a type created in psql. Now, i recover values with npgsql, i pass a executeScalar as i have all function response in only one line.
when i recover datas with npgsql i have all them in the first cell of the datatable.
here's what my postgresql looks like, this response has three rows.

question:

what would be an elegant way to recover my values as i need to output them to csv file.
 should i parse the string and create my lines ? if so what lib would help, is there something like XML parser but for postgresql responses ?
 
or is there a way to get the answer of postgres query in a better recovery solution with npgsql ?

thank you in advance for help.


----------------- answers i receive from pgsql function in a string .-------------------------------
"{\"(10004,Aeby,Aloys,\\\"Rte du Vignoble\\\",33,1175,lala,\\\"\\\",\\\"{1,2}\\\",968,48.4000015,26.6200008,0)\",\"(10005,Aeby,\\\"Andr¿ Christian\\\",\\\"Route de St-Livres\\\",7,1175,lala,AEBYAN000,\\\"{3,4}\\\",1466,73.3000031,40.3150024,0)\",\"(10006,Aeby,Freddy,\\\"Route du Moulin Martinet\\\",11,1175,lala,AEBYFR000,,,,,)\",\"(10009,Allemand,\\\"Pierre Ambroise\\\",\\\"Rte du Vignoble\\\",3,1175,Lavigny,ALLEPI000,\\\"{7,8}\\\",3590,179.5,98.7249985,0)\"}"


toshi
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 14 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros