Get Max Len of each column in dataset
I have the follwoin to count the number of completed rows in an excel spreadsheet:
Code:
Dim objDataAdapter3 As New OleDbDataAdapter()
objDataAdapter3.SelectCommand = cmdExcel3
Dim objDataSet3 As New DataSet
objDataAdapter3.Fill(objDataSet3)
Dim i As Integer = 0
While i <= objDataSet3.Tables(0).Rows.Count - 1
If objDataSet3.Tables(0).Rows(i)("CLI").ToString().Trim() = String.Empty Then
objDataSet3.Tables(0).Rows.RemoveAt(i)
Else
i += 1
End If
End While
I would like to return at the same point the largest LEN of each column so that i can validate wether or not they have entered something that is too large for me sql database.
Any ideas?