asp.net - how to find the maximum length of a column in a datatable using linq -


how find maximum length of column in datatable using linq in vb.net want max length in col1 5.how can achieve using linq

    dim dt new datatable     datatable.columns.add("col1")     datatable.rows(0).item("col1")="123"`val inserted     datatable.rows(1).item("col1")="1234"`val inserted     datatable.rows(2).item("col1")="12345`val inserted 

try this, vb.net one.

dim datatable new datatable() datatable.columns.add("col1") datatable.rows.add("123") datatable.rows.add("123456") datatable.rows.add("12345") datatable.rows.add("z") datatable.rows.add("abcd") datatable.rows.add("cd") datatable.rows.add("z") datatable.rows.add("za123456akwef")`  datatable.asenumerable().select(function(r) r.field(of string)("col1").length).max 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -