1: //Retriving all the records from Users table
2: string sql = "SELECT * FROM Utenti ORDER BY id ASC";
3: //Executing the query and filling a new DataAdapter
4: OleDbDataAdapter adapter = new OleDbDataAdapter(sql, connection);
5: //Filling a DataSet with all the data conteined inside the DataAdapter
6: DataSet dataset = new DataSet();
7: adapter.Fill(dataset);
8: //Assigning the root node name of the XML document that will be generated
9: dataset.DataSetName = "ListaUtenti";
10: //Setting up the root node name of every single record
11: dataset.Tables[0].TableName = "Utente";
12: //Generating the XML document retriving the data from the DataSet previusly filled
13: XmlDocument xmlDoc = new XmlDataDocument(dataset);
14: //Saving the XML flow Document, filled with all the reccords contained by the Users ACCESS table
15: xmlDoc.Save(Server.MapPath("dati/Utenti.xml"));
1: 'Retriving all the records from Users table
2: Dim sql As String = "SELECT * FROM Utenti ORDER BY id ASC"
3: 'Executing the query and filling a new DataAdapter
4: Dim adapter As New OleDbDataAdapter(sql, connection)
5: 'Filling a DataSet with all the data conteined inside the DataAdapter
6: Dim dataset As New DataSet
7: adapter.Fill(dataset)
8: 'Assigning the root node name of the XML document that will be generated
9: dataset.DataSetName = "ListaUtenti"
10: 'Setting up the root node name of every single record
11: dataset.Tables(0).TableName = "Utente"
12: 'Generating the XML document retriving the data from the DataSet previusly filled
13: Dim xmlDoc As New XmlDataDocument(dataset)
14: 'Saving the XML flow Document, filled with all the reccords contained by the Users ACCESS table
15: xmlDoc.Save(Server.MapPath("dati/Utenti.xml"))