Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi my name is vishal.
I was wondering what is equivalent of winsock properties of UBound of vb6 in c# windows forms with sql server2008?
I know this is naive question but with this answer i can solve my other problems with winsock in c# windows forms.
Given below is code in vb6 of using UBound property of winsock into table named:reprocess in Ms access.
VB
Private Sub Form_Load()
On Error GoTo errh
    Me.Icon = MDIForm1.Icon
    Dim vSQLStr As String
    Dim oRS As New ADODB.Recordset
    Dim i As Long
    Dim dBOOL As Boolean
    Dim dMstr As String
    Dim dPID As String
    vSQLStr = "select ManufacturerName,DCS_ip_address from reprocess"
    oRS.Open vSQLStr, adoDatabase, adOpenForwardOnly, adLockReadOnly
    lstIP.Clear
    dBOOL = False
    Do While Not oRS.EOF
         '// Do something with the data'
         If (oRS.Fields("DCS_ip_address").Value <> "") Then
            For i = 0 To MDIForm1.sckClient.UBound
               If (oRS.Fields("DCS_ip_address").Value = MDIForm1.sckClient(i).RemoteHostIP) Then
                   lstIP.AddItem oRS.Fields("ManufacturerName").Value & " - " & oRS.Fields("DCS_ip_address").Value
                   dBOOL = True
                   Exit For
               End If
            Next i
        End If
         oRS.MoveNext
    Loop
    oRS.Close
 Exit Sub
errh:
    MsgBox Err.Description, vbCritical
End Sub

where lstIP is name of my listbox in vb6 adodb with Ms access.
where sckClient is name of my winsock control in vb6 adodb with Ms access.

I just want to know if there is any property equivalent of UBound of winsock control of vb6 adodb with Ms access in winsock control of c# windows forms?

Can anyone help me please?Any help or guidance in solving of this problem would be greatly appreciated.
Posted

UBound is simply the upper bound: sckClient is an array of WinSock controls.
 
Share this answer
 
Comments
Member 10248768 12-Jun-14 5:39am    
No sckClient is name of my winsock control in MDIForm1 which is a mdi parent form to all other child forms in vb6 adodb with Ms access. I did not declare sckClient as an array in vb6. Reply please?
As mentioned in Solution 1, UBound means the upper bound of an array. In this case on the winsock control it is the upper bound of the connections. See http://www.vbforums.com/showthread.php?301503-Winsock-Connection-(array)[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900