Array index is not accessable because it is Friend

Posted by user3738194 on Stack Overflow See other posts from Stack Overflow or by user3738194
Published on 2014-06-13T15:21:28Z Indexed on 2014/06/13 15:24 UTC
Read the original article Hit count: 206

Filed under:
|
|

I am getting and error when I bring my code into another project. In a blank project it works fine, I really have no idea how to get around it, here is the error

Error 1 'System.Data.Index' is not accessible in this context because it is 'Friend'.

        Dim DataString As String = txtAdvancedCommand.Text
    ' Create an array containing from each letter in Textbox
    Dim charArray() As Char = DataString.ToCharArray

    For index = 0 To charArray.GetUpperBound(0)      <-----ERROR on word index
        Try
            'Now lets send the data
            If SerialPort.IsOpen Then
                SerialPort.Write(charArray(index) & vbCrLf)    <-----ERROR on word index
            Else
                ConnectSerial()
                SerialPort.Write(charArray(index) & vbCrLf)    <-----ERROR on word index
            End If
        Catch e As Exception
            txtLog.AppendText(e.Message & vbCrLf)
        End Try
    Next

now the project I am bringing into has a DLL and I suspect it has something to do with it, I cannot get the source code to the DLL so is there another way around this?

© Stack Overflow or respective owner

Related posts about arrays

Related posts about vb.net