Dim dataFile as String = "spesa.xml"
' prima c'è procedura x scegliere db, ke qui x semplicità ho omesso
'nota: le 4 righe sotto sarebbero 2...
Dim fin as New FileStream (Server.MapPath(dataFile),FileMode.Open,FileAccess .Read,FileShare.ReadWrite)
Dim fout as New FileStream (Server.MapPath(dataFile),FileMode.Open,FileAccess .Write,FileShare.ReadWrite)
Dim guestData as New DataSet()
Dim newRow as DataRow
err.Text = ""
guestData.ReadXml(fin)
fin.Close()
'inzia a scrivere nel xml
newRow = guestData.Tables(0).NewRow()
newRow("num")=num.Text ' un textbox ke c'è nella pag.
newRow("data")=Format(Now,"dd/MM/yyyy")'oggi
newRow("ID")=Format(now, "dd") 'oggi, xò solo giorno
guestData.Tables(0).Rows.Add(newRow)
guestData.WriteXml(fout, XmlWriteMode.WriteSchema)
fout.Close()
' ha scritto.. devo mettere un if ke guarda i vari ID presenti, vede se quello ke sta scrivendo è > e poi scrive .. come faccio??