Hi guys,
What is the way to effectively populate a datatable with incoming serial data?
I've been reading around and found one closest to what I need (I think):
But I'm getting "argument not specified for parameter" (as shown in attachment) and if I try filling it with "ByVal bytes_Input As Byte()" it is still going nowhere.
I'm still trying to get my head around this whole "invoke" business so any help understanding it would be appreciated too.
Thanks.
What is the way to effectively populate a datatable with incoming serial data?
I've been reading around and found one closest to what I need (I think):
vb.net Code:
Public Sub UpdateGrid(ByVal bytes_Input As Byte()) If Me.InvokeRequired Then Me.Invoke(New MethodInvoker(AddressOf UpdateGrid())) Else Dim strTemp As New StringBuilder(bytes_Input.Length * 2) DataTableBuffer = New DataTable() DataTableBuffer.Columns.Add("%") For Each b As Byte In bytes_Input strTemp.Append(Conversion.Hex(b)) dr = DataTableBuffer.NewRow() dr("%") = Conversion.Hex(b) DataTableBuffer.Rows.Add(dr) Next DataGridView1.DataSource = DataTableBuffer End If End Sub
But I'm getting "argument not specified for parameter" (as shown in attachment) and if I try filling it with "ByVal bytes_Input As Byte()" it is still going nowhere.
I'm still trying to get my head around this whole "invoke" business so any help understanding it would be appreciated too.
Thanks.