I was recently asked a weird question in an interview here it is;
Private Function sorttable (ByVal dt As DataTable, ByVal sorttype$, ByVal sort_direction$) As DataTable
Dim dv As DataView
Dim dt2 As DataTable
dt2 = dt.Clone
dt2.Merge(dt)
dv = dt2.DefaultView
dv.Sort = sorttype & " " & sort_direction
Return dv.ToTable()
End Function
well this function works sorts correctly but there is a problem about it(well at least the interviewer claimed). Well I couldn't figure out what it was.Any ideas?