D
David Fúnez
I have a little APP for an iPAQ that runs Ok but it does not show any
record, the problem is with the XML File as shown.
The APP is a DataGrid and two Buttons, one to save data an one to exit the
App.
So, any help will be wellcome.
**** The Code *****
Dim dsLibros As DataSet
Dim dtPrestados As DataTable
Dim xmlFile As String = "Libros.xml"
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
dtPrestados = New DataTable("prestados")
dtPrestados.Columns.Add("Id", GetType(Integer))
dtPrestados.Columns.Add("Titulo", GetType(String))
dtPrestados.Columns.Add("prestadosA", GetType(String))
dtPrestados.Columns.Add("Fecha", GetType(Date))
dtPrestados.Columns.Add("Devuelto", GetType(Boolean))
With dtPrestados.Columns("id")
.AutoIncrement = True
.AutoIncrementSeed = 1
End With
dsLibros = New DataSet("Libros")
dsLibros.Tables.Add(dtPrestados)
dgLibros.DataSource = dsLibros.Tables(0) ' that's Ok, it shows the
columns
******* Mi problem is here, if i use this routine:
If File.Exists(xmlFile) Then
dsLibros.ReadXml(xmlFile)
Else
MsgBox("File doesn't exists")
End If
******* shows the File doesn't exists Message,
******* if i put this line: dsLibros.ReadXml(xmlFile) **** out of the
routine like this
*** dgLibros.DataSource = dsLibros.Tables(0)
*** dsLibros.ReadXml(xmlFile)
*** it lounches an error
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave.Click
dsLibros.WriteXml(xmlFile)
End Sub
record, the problem is with the XML File as shown.
The APP is a DataGrid and two Buttons, one to save data an one to exit the
App.
So, any help will be wellcome.
**** The Code *****
Dim dsLibros As DataSet
Dim dtPrestados As DataTable
Dim xmlFile As String = "Libros.xml"
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
dtPrestados = New DataTable("prestados")
dtPrestados.Columns.Add("Id", GetType(Integer))
dtPrestados.Columns.Add("Titulo", GetType(String))
dtPrestados.Columns.Add("prestadosA", GetType(String))
dtPrestados.Columns.Add("Fecha", GetType(Date))
dtPrestados.Columns.Add("Devuelto", GetType(Boolean))
With dtPrestados.Columns("id")
.AutoIncrement = True
.AutoIncrementSeed = 1
End With
dsLibros = New DataSet("Libros")
dsLibros.Tables.Add(dtPrestados)
dgLibros.DataSource = dsLibros.Tables(0) ' that's Ok, it shows the
columns
******* Mi problem is here, if i use this routine:
If File.Exists(xmlFile) Then
dsLibros.ReadXml(xmlFile)
Else
MsgBox("File doesn't exists")
End If
******* shows the File doesn't exists Message,
******* if i put this line: dsLibros.ReadXml(xmlFile) **** out of the
routine like this
*** dgLibros.DataSource = dsLibros.Tables(0)
*** dsLibros.ReadXml(xmlFile)
*** it lounches an error
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave.Click
dsLibros.WriteXml(xmlFile)
End Sub