How can I do this? It gives me an error saying: Inconvertable type mismatch between SourceColumn 'Hash' of Byte[] and the DataColumn 'Hash' of String.
KT
How can I do this? It gives me an error saying: Inconvertable type mismatch between SourceColumn 'Hash' of Byte[] and the DataColumn 'Hash' of String.
KT
Try converting the byte array to a string
VB Code:
Dim bytByte() As Byte, strString As String Dim myEncoding As New System.Text.ASCIIEncoding() strString = myEncoding.GetString(bytByte)
I used the sql datareader instead and created a new field entry for each column in an added row. Casting the binary field data as a byte() array type worked fine! In any case, I really appreciate you replying with a suggestion.. You da man.. :afrog:
KTVB Code:
Public Sub GetSubmitted(ByVal dataset As DataSet) Dim con As New SqlConnection(ConnectionString) Dim cmd As New SqlCommand("GetSubmitted", con) Dim param As SqlParameter cmd.CommandType = CommandType.StoredProcedure Dim r As SqlDataReader Dim Table As DataTable = dataset.Tables(0) Try con.Open() r = cmd.ExecuteReader Do While r.Read Dim row As DataRow = Table.NewRow row("ID") = CType(r("ID"), Integer) row("Time") = CType(r("Time"), DateTime) row("Tracker") = CType(r("Tracker"), String) row("TrackerType") = CType(r("TrackerType"), Integer) row("Hash") = CType(r("Hash"), Byte()) row("Section") = CType(r("Section"), String) row("Name") = CType(r("Name"), String) row("Description") = CType(r("Description"), String) row("Size") = CType(r("Size"), Integer) row("Seeds") = CType(r("Seeds"), Integer) row("Peers") = CType(r("Peers"), Integer) row("InfoUrl") = CType(r("InfoUrl"), String) Table.Rows.Add(row) Loop Finally con.Close() End Try End Sub