Ich bin dabei mithilfe eines alten vb6 Buches eine Datenbankanwendung zu programmieren. Im Buch kommt der Functions Typ "Field" vor. Durch was kann ich das in vb2008 ersetzen?
Hier ein Ausschnitt:
mfg
Hier ein Ausschnitt:
VB.NET-Quellcode
- ...
- ReadRecord()
- End SubPrivate Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
- cnnADO.Close()
- End SubPrivate Sub ReadRecord()
- txtID.Text = GetValue(rsADO!PubID)
- txtName.Text = GetValue(rsADO![Company_Name])
- txtStadt.Text = GetValue(rsADO!City)
- txtStaat.Text = GetValue(rsADO!State)lblNr.Text = "Datensatz " & rsADO.AbsolutePosition & " von " & rsADO.RecordCount
- End Sub
- Private Function GetValue(ByVal fld As Field) As String
- If IsDBNull(fld) Then
- GetValue = ""
- Else
- GetValue = fld
- End IfEnd Function
mfg