1

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 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.