Hi Experts,
I have the following code: -
Dim rs As ADODB.Recordset
Connect()
rs = conn.Execute("SELECT * FROM config")
Me.Text = rs!RigTitle
MyString = rs!SSDNo
If MyString.Length = 4 And IsNumeric(rs!SSDNo) Then
TxtSSDNo.Text = rs!SSDNo
Else
ErrorNo = 2
End If
MyString = rs!RoutingStage
If MyString.Length = 3 And IsNumeric(rs!RoutingStage) Then
StageRef = rs!RoutingStage
Else
ErrorNo = 3
End If
WorkingDatabase = "testdata"
If WorkingDatabase = "" Then
ErrorNo = 4
Else
AxLogResults1.set_SET_DataBaseName(WorkingDatabase)
End If
If Not IsNumeric(rs!comsport890) Then
ErrorNo = 5
Else
CommsPort = CDec(rs!comsport890)
End If
If Not IsNumeric(rs!CtrlPort890) Then
ErrorNo = 6
Else
ControlPort = CDec(rs!CtrlPort890)
End If
If Not IsNumeric(rs!MeterPort) Then
ErrorNo = 7
Else
MeterPort = CDec(rs!MeterPort)
End If
rs.Close()
conn.Close()
This has been taken from a vb6 program. When I place it into vb.net 2005 I get the error message and an underline on all parts of code that start “rs!” ie, “rs!MeterPort”: -
Overload resolution failed because no accessible 'Fields' accepts this number of arguments.
What is this please and how do I overcome this. Sorry I’m new to vb.net and currently migrating from vb6.
Many Thanks
Lee
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.