> Public oDataSet As DataSet = New DataSet > Private oDataView As DataView = New DataView > > oDataSet.Tables.Add("Temp") > > oDataSet.Tables(0).Columns.Add("Extension", GetType(System.String)) > oDataSet.Tables(0).Columns.Add("LastUpdate", GetType(System.DateTime)) > oDataSet.Tables(0).Columns.Add("Name", GetType(System.String)) > oDataSet.Tables(0).Columns.Add("Size", GetType(System.Int32)) > oDataSet.Tables(0).Columns.Add("JustName", GetType(System.String)) > oDataSet.Tables(0).Columns.Add("CreationTime", GetType(System.DateTime)) > > ' Create the view > oDataView = oDataSet.Tables(0).DefaultView > > ' Sort the dataset into the primary key > oData.oDataView.Sort = "AI" > > ' For each record > For lnCounter = 0 To oData.nCount - 1 > loRow = oData.oRows(lnCounter) > > Next >>
> Using loSQLConnection As New SqlConnection(oApp.aConnection(nConnectionString, 1)) > oCommand.Connection = loSQLConnection > oDataAdapter.Fill(oDataSet) > End Using > > ' Adjust to our default name > oDataSet.Tables("Table").TableName = "Temp" > > ' Record count > nCount = oDataSet.Tables("Temp").Rows.Count > > oDataView = New DataView > > ' If we have no record > If nCount = 0 Then > oRows = Nothing > Else > oDataView = oDataSet.Tables("Temp").DefaultView > oRows = oDataSet.Tables("Temp").Rows() > End If > > ' Sort the dataset into the primary key > oData.oDataView.Sort = "AI" > > ' For each record > For lnCounter = 0 To oData.nCount - 1 > loRow = oData.oRows(lnCounter) > > Next >>
> For Each loRowView In oData.oDataView > Next >>