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

TechCrystal Article

free one-click streaming Video right from this site (no obligation)
Create a Typed .NET DataSet
for Optimistic Row Locking
(via Drag & Drop
from a Db2 for i table definition)

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


Why are we here?

.NET OO DataSet right after drag and drop
  • To find out how to quickly transfer an existing Db2 for i table or external data structure definition into an OO data structure

  • To find out how to easily write c# (or VB.NET) that creates an XML string that is based on the IBM Db2 for i (or Microsoft SQL Server) column data subset being maintained by the application program user

  • We're interested in hearing about techniques used to facilitate optimistic record locking and/or an even more granular method than the row level time stamp method (so that 2 or more non-conflicting user or program update processes can maintain the same table row concurrently)

  • We want to hear about the ability to use Db2 for i or SQL Server columns by name in the compiled code (instead of by index number or index name)

  • We want to hear about enforcing OO programming rules specific to the column data type (and taking advantage of them) at design time and compile time (instead of waiting until run time to find out about basic fundamental data handling mismatches)

the Essence

This technical article features a video showing how to create a strongly-typed .NET OO c# DataSet object based on a Db2 for i Table (DDS or DDL Physical File or external data structure), using the OLE DB Provider from IBM (distributed in the IBM ACS Windows Appication Package).  The end result is an equivalent set of data elements, when compared to what IBM i developers do when they want to create an external data structure (EDS or *FILE object type with PF attribute) based on a subset of a record format for use in their programming. 

The DataSet object type that comes with the .NET Framework is sort of like an IBM i multi-occurence external data structure on steroids, as the .NET DataSet also contains methods (routines) that can be used by the developer 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 how to generate the XML string and how to use database column names in compiled code, which is something several native IBM i languages enable by definition, but is something that is not normally available (at compile time at least) for SQL-accessed database column names in c# or VB.NET (unless you use OO programing with this type of DataSet).  It is speculated that languages like c# and VB.NET don't consider this a priority and also they promote a style of programming with a more strict separation of the data layer and/or UI layer from the application layer and also have to focus on offering SQL style connectivity to multiple vendors (each of whom develop their own adapter). 

There is also available for free 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™.



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 (like the .NET Data Provider is, for example, when running Db2 for i SQL based processes in the 4.8 .NET framework)
    Db2 for i OLE DB Provider install from IBM i ACS WindowsAP
  • classic .NET Framework (most any version) installed on your workstation, although probably best to target 4.7.2 and above
  • access to a Db2 for i database (most any OS level, but probably best at IBM i 5.4 or higher)
  • Visual 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) Remove 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     go to next series page     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-2026