DataView

01/03/2005 - 18:42 por Jv | Informe spam
Hola a todos
tengo un problema con el metodo sort del dataview
lleno un dataset
y luego lo asigno a un dataview
luego uso el sort pero no me ordena los datos
hay algo que me hace falta?
Dim tabla As String = "tabla"
Dim dv As New DataView(mDs.Tables(tabla))
dv.Sort = "codigo"
Dim intActual As Integer
Dim intSiguente As Integer
Dim dr As DataRow
Dim drTabla As DataRow = dtTabla.NewRow
If dv.Table.Rows.Count Then
intActual = dv.Table.Rows(0).Item
("codigo")
intSiguente = dv.Table.Rows(0).Item
("Codigo")
drTabla("Codigo") = dv.Table.Rows
(0).Item("Codigo")
dtTabla.Rows.Add(drTabla)
For Each dr In dv.Table.Rows
intSiguente = dr("Empresa")
If intActual <> intSiguente Then
drTabla = dtTabla.NewRow
drTabla("Codigo") = dr
("Codigo")
dtTabla.Rows.Add(drTabla)
intActual = intSiguente
End If
Next
Return dtTabla
End If
 

Preguntas similares