Visual Basic Upgrade Wizard
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngmigrate' list.


Bill Bassler
-- Moved from [aspngfreeforall] to [aspngmigrate] by Marcie Jones <Click here to reveal e-mail address> --

I have an existing VB 6.0 COM dll that I'd like to upgrade to .NET.
I've seen the Wizard do stuff like data typing and syntax changes.

I would imagine, the main issue might be the conversion from ADO to
ADO.Net.
I realize this is optional but I would want to attempt it.
What are the main issues with respect to conversion from ADO & mainly
recordset manipulation to an XML based system like ADO.Net?

Anyone have any issues, opinions.

Reply to this message...
 
    
Brian C Freeman
This class can emulate the syntax for an ADO call. This allows for
extremely minimal changes to the code in the ASP pages.

Brian

----
Namespace Legacy
Public Class MyRecordSet

'Created by Brian Freeman to Assist in ASP Porting

Private m_CurrentRow As Integer =3D -1
Private m_DataTable As DataTable
Private m_NullAreEmptyString As Boolean =3D True

Public Sub Close()
'nothing
End Sub
Public Property TreatNullsAsEmptyStrings() As Boolean
Get
Return m_NullAreEmptyString
End Get
Set(ByVal Value As Boolean)
m_NullAreEmptyString =3D Value
End Set
End Property
Public Function GetRows() As Object(,)
Dim a(Me.m_DataTable.Columns.Count - 1, _
Me.m_DataTable.Rows.Count - 1)
Dim r, c As Integer
Dim oRow As Data.DataRow
For r =3D 0 To Me.m_DataTable.Rows.Count - 1
Me.m_CurrentRow =3D r
For c =3D 0 To Me.m_DataTable.Columns.Count - 1
a(c, r) =3D FieldsValue(c)
Next
Next

Return a

End Function

Public Sub New(ByVal oDataTable As DataTable)
m_DataTable =3D oDataTable
m_CurrentRow =3D 0
End Sub

Public Sub MoveNext()
Me.m_CurrentRow =3D Me.m_CurrentRow + 1
End Sub

Public ReadOnly Property RecordCount() As Integer
Get
Return Me.m_DataTable.Rows.Count
End Get
End Property
Public ReadOnly Property EOF() As Boolean
Get
If m_DataTable.Rows.Count <=3D Me.m_CurrentRow Then
Return True
Else
Return False
End If
End Get
End Property

Default Public ReadOnly Property FieldsValue(ByVal sFieldName As
String) As Object
Get
Dim oRow As DataRow
oRow =3D Me.m_DataTable.Rows(Me.m_CurrentRow)
Dim o As Object
o =3D oRow(sFieldName)
If m_NullAreEmptyString Then
If IsDBNull(o) Then
o =3D ""
End If
End If

Return o
End Get
End Property
Default Public ReadOnly Property FieldsValue(ByVal nFieldIndex
As Integer) As Object
Get
Dim oRow As DataRow
oRow =3D Me.m_DataTable.Rows(Me.m_CurrentRow)
Dim o As Object
o =3D oRow(nFieldIndex)

If m_NullAreEmptyString Then
If IsDBNull(o) Then
o =3D ""
End If
End If

Return o
End Get
End Property

Public ReadOnly Property BOF() As Boolean
Get
If m_DataTable.Rows.Count > 0 And Me.m_CurrentRow =3D 1
Then
Return True
Else
Return False
End If

End Get
End Property
Public ReadOnly Property Fields() As DataColumnCollection
Get
Return m_DataTable.Columns
End Get
End Property

End Class
End Namespace

-----Original Message-----
From: Bill Bassler [mailto:Click here to reveal e-mail address]=20
Sent: Thursday, February 28, 2002 11:18 AM
To: aspngmigrate
Subject: [aspngmigrate] Visual Basic Upgrade Wizard

-- Moved from [aspngfreeforall] to [aspngmigrate] by Marcie Jones
<Click here to reveal e-mail address> --

I have an existing VB 6.0 COM dll that I'd like to upgrade to .NET.
I've seen the Wizard do stuff like data typing and syntax changes.

I would imagine, the main issue might be the conversion from ADO to
ADO.Net.
I realize this is optional but I would want to attempt it.
What are the main issues with respect to conversion from ADO & mainly
recordset manipulation to an XML based system like ADO.Net?

Anyone have any issues, opinions.

| [aspngmigrate] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngmigrate.asp =3D JOIN/QUIT

Reply to this message...
 
 
System.Data.DataColumnCollection
System.Data.DataRow
System.Data.DataTable




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com