1

I need to create a means of viewing and editing a postgresql table through C# WPF style app. Is it possible to do this in a DataGrid control? So far I found a class in the .NET framework called SqlDataAdapter, which can return a query result in a DataSet object, and update the data in db appropriately if the DataSet is altered. But I think this is only for Microsoft Sequel Server. Would this work for PostgreSql? And would it be possible to bind the DataSet to a Datagrid?

Thanks, Alex

1 Answer 1

2

npgsql is what I have always used. It uses the same interfaces so instead of a SqlDataAdapter you'll have an NpgsqlDataAdapter that functions the same way. From there, you can populate your DataTable or DataSource and bind that to your DataGrid.

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

2 Comments

Thanks, I have been using Npgsql and did not think to look there. Can the DataTable and DataSource objects be bound to a DataGrid in WPF? I found examples of this, but they were for System.Windows.Forms based controls.

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.