When I update an SQL record with the IP address received by my tcp listener
the SQL record has a sting of square symbols after the IP address. I
believe the squares represent the remaining blank bytes in the Buffer. How
can I trim these squares from my string? I have tried clientV = clientV.Trim
() and clientV = clientV.Trim(Nothing) to no avail.
I receive the IP address as such:
Bytes = CurSocket.Receive(Buffer, Buffer.Length, 0)
SyncLock CurThread
clientV = (System.Text.Encoding.ASCII.GetString(Buffer))
I Then up date SQL:
Dim updateCMD As String = "UPDATE ManagedLists SET mlName = @clValue WHERE
mlID = 849;"
Dim sqlUpdate As SqlCommand = New SqlCommand(updateCMD, Me.SqlConnection1)
sqlUpdate.Parameters.Add(New SqlParameter("@clValue", SqlDbType.VarChar))
sqlUpdate.Parameters("@clValue").Value = clientV
Me.SqlConnection1.Open()
sqlUpdate.ExecuteNonQuery()
Me.SqlConnection1.Close()
Thanks for the Help!