Converting a DataRow to a string

This can help to show a datarow content. Il shows the column name and values for all the column in the row in this format:
ColumnName=value; ColumnName2=value2;

Protected Function DataRowToString(ByVal dr As DataRow) As String
''' For debugging purpose, per example : convert a datarow to a string
''' represantation with all columns contents
Dim result As String = ""
result += Environment.NewLine
For Each col As DataColumn In dr.Table.Columns
result += col.ColumnName + "=" + dr(col.ColumnName).ToString() + " ;"
Return result
End Function

No comments: