Examining VB.NET
by Lauren Hightower



Example 1:

For I = 0 to 5
   Dim j as Integer
   J = I
Next
Msgbox J


Example 2:
(a) 
Dim rsRecordset as New ADODB.Recordset

(b)
Dim rsRecordset as Object
Set rsRecordset = CreateObject("ADODB.Recordset")


Example 3:
(a)
Public Sub ChangeString(shString as String)
   If i = 0 Then    
ShString = "Change the String"
   End if
End Sub

(b)
Public Sub ChangeString(ByRef shString as String)
    If i = 0 Then   
ShString = "Change the String"
    End if
End Sub


Example 4:
(a)
spTextValue = Text1
spTextValue = Text1.text


(b)
spEmpName = opRecordset ("EmployeeName")

(c)
spEmpName = opRecordset.Fields("EmployeeName").Value

(d)
     
SpEmpName = opRecordset("EmployeeName").Value


Example 5:
(a)
Dim a(3 to 12) as Integer
(b)
IpInteger = a(3) + a(4) + a(5)

(c)
Dim a(10) as Integer

(d)
IpInteger = a(0) + a(1) + a(2)


Example 6:
(a)
If bpCheck = -1 Then 
    [Process some things]
    End if

(b)
If bpCheck = 1 Then 
    [Process some things]
    End if

(c)     
If bpCheck = True Then
[Process some things]
End if

(d)
opConnection.CommandType = adCmdStoredProcedure

(e)
opConnection.CommandType = 4






2

