Page 1 of 1

Oradirect with WPF

Posted: Mon 01 Sep 2008 19:49
by matthieu de graaf
Hi,

I'm working with Oradirect 4.75.40.0 with MS Visual Studio 2008.

I'm trying to creat a simple WPF form bounded to Oracle data via Oradirect

My approach is the following

1) Create a strongly typed dataset with a datatable (OraDirect style, option "use provider specific code generator is checked" is used in dataset wizard.

2) Load the data in the datatable in the Window_Loaded event
myDataset.MY_TABLE.Active = true

3) Set the datacontext of my stackpanel containing the text input items to myDataset.myDataTable

e.g


4) What property of the myDataTable do I use for the binding?
I tried binding to the myColumncolumn property of the myDataset.MY_TABLE but this doesn't work

Can you show me where I went wrong?

A little example of Oradirect with WPF would be appreciated. All the samples provided now are windows forms examples.

Regards,

Matthieu de Graaf

Issue solved

Posted: Thu 04 Sep 2008 06:59
by matthieu de graaf
Hi Everybody,

Solved the issue myself.

First of all in step 3 you can only set the datacontext in XAML if you've defined your dataset as a resource (e.g. in the window.resources section)
Unfortunately, the datatable is a inner class of the dataset. I haven't found a way to define a resource referring to an inner class. That's why I've set the datacontext in C# in the loaded event of the Window e.g. this.dataContext = myDataset.MY_TABLE;

In step 4 you refer to the properties of the datatable which have the same name as the columns in your database table.

Matthieu