I have a problem with the databinding in wpf, i want to bind a sql record on a label. Normally in window form i use something like this: Label1.Text = dt.Rows[0]["ColumnName1"].ToString();
But what about WPF..
I have a problem with the databinding in wpf, i want to bind a
Share
You SQL database should fill up your model objects (business logic classes). From there, your WPF view (Xaml file) should be bind to a Controller (View Model if you are in the MVVM pattern) which will be be the bridge between your View and Model in term of binding.
The View will need to bind to the Controller to have access to the data in your model.
Of course the DataContext will need to be specified before. The DataContext is a way to set the source of your data. It must contain the property you are specifying in the Binding attribute of the Label.