I am working in a .net mvc web application with using NPGSQL. In my project, I want to update the records in my postgres database using a .csv file. Maybe someone did it? Can someone send sample code? Someone will tell you how to do it? So far, I have displayed data on my website using C# and NPGSQL.
1 Answer
If you're looking to insert new rows, you may want to look at the PostgreSQL COPY feature; this is exposed by Npgsql via this API.
Otherwise you can use a .NET CSV parser and construct UPDATE statements which you can execute manually.