DS.ReadXml(Application.StartupPath & "\user.xml") Dim DS As New DataSet If DS.Tables(0).Rows.Count = 0 Then MsgBox("nothing") Else Dim i As Integer = 0 For Each r As DataRow In DS.Tables(0).Rows dtgUser.Rows.Insert(i, r("ID"), r("Name")) i = i + 1 Next End If dtgUser.Sort(dtgUser.Columns("ID"), System.ComponentModel.ListSortDirection.Ascending)
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click DS.WriteXml(Application.StartupPath & "\user.xml") End Sub
Dim dv As New Dataview(DS.Tables(0)) dv.Sort="ID DESC" DS.Tables(0)=dv.ToTable
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)