bendr
bendr

Reputation: 2475

Simple DataGrid Binding to Remote SQL Server 2005/8 Database

How can we Use a DataGrid in WPF to show/update/add/delete records in a Table? I have watched/read and tried many tutorials, but I can't find a single, easy to understand tutorial on how to bind data with a remote database.

I can't seem to find anything like this.

Upvotes: 0

Views: 1223

Answers (2)

Pleun
Pleun

Reputation: 8920

Well, if you want to use Linq2Sql (less difficult to learn than EntityFramework) try a tutorial like this one: http://www.codeproject.com/KB/WPF/WPFDataGrid.aspx

or http://www.codeproject.com/KB/WPF/WPFDataGridExamples.aspx

And you will do fine.

Upvotes: 1

samneric
samneric

Reputation: 3218

You are going to have to choose a data access technique to retrieve the records from the DB to create data that you can bind to.

The most modern approach is to use the EntityFramework - excellent concept - It will save you a lot of development time in the long-run but has a huge learning curve.

Not wanting to tackle that, you can use DataSets by connecting to a datasource from the Server Explorer of visual studio, right clicking on the tables that you link and creating a data-bound grid on your WPF page.

Either way, there is more learning to do but hopefully you have more of an idea where to start learning.

Upvotes: 1

Related Questions