What are the advantages of using the IBM .NET provider over OLE or ODBC?
I have been going thought the assembly and the only benefit I see is the
IBM data types and tracing. The only issue I ran into is converting
byte arrays into string. Here is my solution:
Private Function getTable(ByVal SelectCommand As String, ByVal
Connection As iDB2Connection, Optional ByVal convertByte As Boolean =
True) As DataTable
Dim cmd As New iDB2Command(SelectCommand, Connection)
Dim da As New iDB2DataAdapter(cmd)
Dim ds As New DataSet
Try
da.Fill(ds, "table0")
If ds.Tables("table0").Rows.Count = 0 Then
Return New DataTable
ElseIf ds.Tables("table0").Rows.Count > 0 And Not
convertByte Then
Return ds.Tables("table0")
Else
Dim table1 As New DataTable("table1")
' Parse column data types from Table0 to Table1
For Each dc0 As DataColumn In
ds.Tables("table0").Columns
Dim dc1 As New DataColumn(dc0.ColumnName,
dc0.DataType)
If dc1.DataType Is GetType(Byte()) Then
dc1.DataType = GetType(String)
End If
table1.Columns.Add(dc1)
Next
ds.Tables.Add(table1)
' Parse all data from Table0 to Table1
For Each dr0 As DataRow In ds.Tables("table0").Rows
Dim dr1 As DataRow = table1.NewRow()
For i = 0 To dr0.ItemArray.Count - 1
' Convert Byte() to String
' Not sure if other datatypes need some
conversion
This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.