Get the max length for each field of a DataTable
<p>My goal is to show the whole content of a <code>DataTable</code> into a <code>RichTextBox</code> so I thought about using <code>String.Format</code> to make columns but I need to know the max length of contents for each Column.</p>

<p>I found the below C# code on <a href="https://stackoverflow.com/questions/1053560/how-to-get-max-string-length-in-every-column-of-a-datatable">SO</a> but I was unable to translate it to VB.Net:</p>

<pre><code>List&lt;int&gt; maximumLengthForColumns = Enumerable.Range(0, dataTable.Columns.Count)
                                   .Select(col =&gt; dataTable.AsEnumerable()
                                   .Select(row =&gt; row[col]).OfType&lt;string&gt;()
                                   .Max(val =&gt; val.Length)).ToList();
</code></pre>

<p>Any hint on any different (and easier or better) way to reach my goal is appreciated.</p>