Sign In
   Developer Productivity PKGs
Classic .NET Website Design
Accounting Suite for IBM i

TechCrystal Article

Create a .NET DataSet
from Db2 for i Table
via Drag & Drop

(includes link to how-to video,
c# code using column names example,
 and training PDF offer with check-in)

the Essence

This technical article features a video showing how to create a .NET OO c# DataSet object based on a Db2 for i Table (or DDS Physical File or external data structure).  The end result is equivalent to what IBM i developers do when they want to create an external DS object based on a record format for use in their programming. 

The DataSet object type that comes with the .NET Framework is sort of like a multi-occurence external data structure on steroids, as it contains methods (routines) that can be used to populate and manipulate the data contained inside the DataSet at run time.  The main thing you can't accomplish with the .NET DataSet however, is that you can't overlay namespaces.   

This TechCrystal Article contains a link enabling you to stream a How-To video directly from our site (with no obligation or preference-style cookies for that matter).  There is also a c# code example PDF showing use of database column names in compiled code, which IBM i languages enable by definition, but is something that is not available (at compile time) for SQL-accessed database column names in c# or VB.NET (probably because these languages promote a style of programming with a more strict separation of the data layer and typically focus on SQL style connectivity to multiple vendors (each of whom develop their own adapter).  There is also available for download, with website registration, Ch 8 Drag and Drop PF DS to OO DataSet from the Pro Into Module of our Get Running - Tegratecs Code Package™.


Why are we here?

.NET OO DataSet right after drag and drop
  • We want to reference the database columns in the compiled code by name instead of by index

  • We want to enforce the data type rules specific to the column (and take advantage of them) at design time and compile time, instead of waiting until run time to find out about basic fundamental data handling mismatches or problems

  • We are interesting in being able to easily code creation of an XML string that is based on the data being maintained by the application program user (thus it contains only a subset of the rows and columns in the entire file)

  • To quickly transfer an existing Db2 for i database file or data structure definition into a OO data structure

  • We are interested in hearing about techniques used to facilitate optimistic record locking

  • The .NET OO DataSet object comes with quite a few routines right out of the box, making it easier to populate the data structure at run time



A Little More Background

Here are the prerequisites:

  • installation of the OLE DB Provider, from the IBM i ACS Windows Application Package, onto your PC workstation (not required at runtime, so not required on Windows Server IIS for example)
  • Db2 for i OLE DB Provider install from IBM i ACS WindowsAP
  • NET Framework (most any version) installed on your workstation
  • access to a Db2 for i database (most any OS level)
  • Visuals Studio (most any version including Community Edition)
  • Please note full installation details are covered in Ch 8 download PDF offered below  (website user check-in required)


Video
  • Click on picture (and we'll generate a temporary .html link to our site straight away (that enables you to access a copy of our site's protected content)) to get the 6 minute video with option to jump directly to any of the following topics!
  • 1) Intro
  • 2) Create new DataSet object
  • 3) Drag and Drop
  • 4) Remove Table Adapter and fill routine
  • 5) Rename DataSet
  • 6) Rremove columns outside user control
  • 7) Create Runtime Assembly
  • 8) Quick Run Through Chapter 8 Pictures
Click on picture to stream video via .html link directly from tegratecs.com...  The main part is 6:07 minutes long.  Following that, if you want to get into further details, there is a relatively quick, somewhat rough  3:15 minute thumb through of the Chapter 8 pictures.  Download the Chapter 8 pictures for yourself below (website user check-in required).  But yeah, you know, we'd love to see you check-in!
c# code example download showing use of column names at design and compile time

Click on this picture to get free, no obligation PDF download right away containing an applicable portion of production c# code...  We first started using this technique with c# and DataSets created via drag and drop from MS SQL Server in 2011.

download (after registration)

(Chapter 8 (.zip file))

drag and drop PF DS to OO DataSet download





Download Chapter 8 .zip file from Get Running - Tegratecs Code Package™

Please note this .zip download includes only picture files.  In addition to the drag and drop information, there are pictures with directions on how to install the IBM i ACS Windows Application Package (IBM ACS WindowsAP) OLE DB Provider component onto the developer workstation.






        go to the home page Top of Featured Services     go to next series page Next in Tech Reports, White Papers and Presentations     Site Map     Switch to
Mobile View

You are at the web site of Tegratecs Development Corp.  Click here to go to the home page of this site...
Offering Innovation & Providing ROI
without building Islands of Automation
Our contact information:
Tegratecs Development Corp.®
1320 Tower Road
Schaumburg, IL 60173
847-397-0088
800-739-FPSS
( please contact us or create a Web User ID or sign in )
© 2012-2025