Problem not being solved vb

im doing a project and am having problem getting this code correct could you please have a look at it and help me understand were i am making the mistake

the code

Private Sub m_buttonAddUserRole_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles m_buttonAddUserRole.Click
Dim roleIndex As Integer = ListBox1.SelectedIndex
If (roleIndex = -1) Then
Return
End If
' Get the current user index.
Dim userIndex As Integer = ListBox2.SelectedIndex
' Should we ignore the the event?
If (userIndex = -1) Then
Return
End If
' Get the identifiers.
Dim userID As Integer = CType(ListBox1.Rows(userIndex)("user_id"), Int32)
Dim roleID As Integer = CType(m_roleTable.Rows(roleIndex)("role_id"), Int32)
end sub

Dim userID As Integer = CType(ListBox1.SelectedItem, Int32) will error since you cannot convert a String to an Integer.
.To get the value, use something as: Dim userID As String = ListBox1.SelectedItem .

rows() is an Array, as: dim rows() as string={"row 1","row 2","row etc."} and if you want a value from it, use msgbox(rows(2)) .
Since you are trying to only set 1 String to a String Array, you will need to set it as I did, not as setting it to a String only as = "blah" & "blah".

Also, not a db.coder here, though it looks like your error line is a connection.string for a database, not to get the rows from a DataTable.

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...