Question How to use a Dataset without SQLDataAdapter?

Rambunctious One

New member
Joined
Jun 4, 2025
Messages
2
Programming Experience
10+
I want to use databinding in my xaml without using dependency properties and just binding to dataset fields.

How can I create an in memory dataset with fields and then data bind to zaml?

No SQL database underlying, just like this.

Dataset.New()
Dataser.AddField()
Dataset.Open.
 
Most people using WPF don't use the DataSets the way WinForms users do. Most of them will be using things that have IEnumerable interfaces like lists, collections, and Entity Framework tables.

But to answer your question, yes, you can always create a DataSet and add DataTable's and the rows for the tables. This has always been true even in WinForms. There was never a requirement for you to load data from a database. In WPF, you just need to give the appropriate binding path that points to the tables.
 
See Microsoft documentation for how to populate a DataTable programmatically without a database:
 
See Microsoft documentation for how to populate a DataTable programmatically without a database:

Thank you, I am completely new to c# so I don't know what to ask. How to I set the newly created dataset in c# and databinding so it is viewable by my xaml?
 
If you are new to C#, going straight into WPF is going to be a very steep learning curve. As much as I tell people that WinForms is a dead end, it might be worth becoming more familiar first with the C# language doing just console programming, and then moving up to WinForms as you get more familiar, and then finally stepping up to WPF. It also pains me to write this, but another alternative might be to use WPF but write WPF like you were writing WinForms code just to ease the learning curve a bit.

Let me step back a bit though and ask: Why do you even need a DataSet?
 
Back
Top Bottom