IBM Database Add-Ins for Visual Studio  

Creating IBM Data Sources for XAML Applications

If you want to create applications by using Windows Presentation Foundation (WPF) with Extensible Application Markup Language (XAML), you can use the IBM Database Add-Ins for Visual Studio to create IBM data sources for the applications.

With the add-ins, you can generate a sample XAML application from an IBM database table, view, or procedure, and then use one or more of the following three bindings that are generated in the sample application:

Prerequisite:  The Microsoft® Visual J#® 2.0 Redistributable Package - Second Edition (x86) must be installed on your system. You can download the package from the Microsoft Visual J# 2.0 Redistributable Package - Second Edition (x86) Web page.

To create an IBM data source for an XAML application:

  1. In the Server Explorer under your data connection, right-click a table, view, or procedure, and then select Generate XAML Application on the shortcut menu.

    If you are generating the XAML application from a procedure, the Run Options window opens. In the window, specify a value for each IN and INOUT parameter, and then click Run.

    The sample XAML application is generated, with the IBM data source bound to the free text, listbox and grid controls.

    The open SampleDatSet.xsd file shows the dataset that was generated from your selected database object.

  2. Open the Window1.xaml file.

    The Design view shows the generated controls, and the XAML view contains the underlying design code. The Window1.xaml.cs code-behind file contains the bindings for the data source.

  3. Optional: To add more free-text fields, perform the following steps:
    1. In <snippet6> of the XAML design code, copy and paste the code for the generated <TextBox> element, and then change the column name in the Text attribute.
    2. In <snippet5>, copy and paste the <Label> element, and then change the content of the label.
  4. Optional: To see the controls populated with values from the selected database object, press F5 to run the application.
  5. Use the generated data source and binding code from the sample XAML application as a template for adding IBM data sources to your own XAML application.

See Also

IBM Data Sources in XAML Applications | Using Visual Studio 2008 Technology in IBM Database Add-Ins for Visual Studio


.NET Development Forum   developerWorks: Visual Studio .NET   DB2 FAQs   IDS FAQs

© Copyright IBM Corporation 2002, 2019. All Rights Reserved.