By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,254 Members | 2,418 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,254 IT Pros & Developers. It's quick & easy.

Programming iPAQ

P: n/a
I have a little APP for an iPAQ that runs Ok but it does not show any
record, the problem is with the grid as shown, it has not a DATAMEMBER
Property to show the records.

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
'dgLibros.DataMember = "Prestados" ====> The problem

If File.Exists(xmlFile) Then
dsLibros.ReadXml(xmlFile)
End If
End Sub

Private Sub btnSalir_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSalir.Click
Me.Close()
End Sub

Private Sub btnSalvar_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSalvar.Click
dsLibros.WriteXml(xmlFile)
End Sub
--
David Fúnez
Tegucigalpa, Honduras

Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi,

You have to specify the path for file.exists to work. Try something
like this.

Dim strPath As String

strPath = System.IO.Path.GetDirectoryName( _

System.Reflection.Assembly.GetExecutingAssembly(). GetName().CodeBase)

Dim fXml As New FileInfo(strPath & "\config.xml")

Dim bXml As Boolean = fXml.Exists

If bXml Then

ds = New DataSet

ds.ReadXml(strPath & "\config.xml")

End If

Ken

--------------------

"David Fúnez" <df****@hotmail.com> wrote in message
news:eh****************@TK2MSFTNGP11.phx.gbl...
I have a little APP for an iPAQ that runs Ok but it does not show any
record, the problem is with the grid as shown, it has not a DATAMEMBER
Property to show the records.

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
'dgLibros.DataMember = "Prestados" ====> The problem

If File.Exists(xmlFile) Then
dsLibros.ReadXml(xmlFile)
End If
End Sub

Private Sub btnSalir_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSalir.Click
Me.Close()
End Sub

Private Sub btnSalvar_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSalvar.Click
dsLibros.WriteXml(xmlFile)
End Sub
--
David Fúnez
Tegucigalpa, Honduras


Nov 21 '05 #2

P: n/a
it doesn't work ....

Thanks anyway....

--
David Fúnez
Tegucigalpa, Honduras
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hi,

You have to specify the path for file.exists to work. Try
something
like this.

Dim strPath As String

strPath = System.IO.Path.GetDirectoryName( _

System.Reflection.Assembly.GetExecutingAssembly(). GetName().CodeBase)

Dim fXml As New FileInfo(strPath & "\config.xml")

Dim bXml As Boolean = fXml.Exists

If bXml Then

ds = New DataSet

ds.ReadXml(strPath & "\config.xml")

End If

Ken

--------------------

"David Fúnez" <df****@hotmail.com> wrote in message
news:eh****************@TK2MSFTNGP11.phx.gbl...
I have a little APP for an iPAQ that runs Ok but it does not show any
record, the problem is with the grid as shown, it has not a DATAMEMBER
Property to show the records.

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
'dgLibros.DataMember = "Prestados" ====> The problem

If File.Exists(xmlFile) Then
dsLibros.ReadXml(xmlFile)
End If
End Sub

Private Sub btnSalir_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSalir.Click
Me.Close()
End Sub

Private Sub btnSalvar_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSalvar.Click
dsLibros.WriteXml(xmlFile)
End Sub
--
David Fúnez
Tegucigalpa, Honduras

Nov 21 '05 #3

P: n/a
I think you're looking for DisplayMember - that should do it for you.

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"David Fúnez" <df****@hotmail.com> wrote in message
news:eh**************@TK2MSFTNGP11.phx.gbl...
I have a little APP for an iPAQ that runs Ok but it does not show any
record, the problem is with the grid as shown, it has not a DATAMEMBER
Property to show the records.

So, any help will be wellcome.

**** The Code *****
Dim dsLibros As DataSet
Dim dtPrestados As DataTabl

Nov 21 '05 #4

P: n/a
I am coming to your query a bit late, but from what I can see quoted below,
your problem may be the understanding of the Pocket PC file Structure.

\ indicates the root folder for the Pocket PC. So if you have your xml data
file in your program's folder, which in turn is in the Program Files folder,
you would read it as follows:

ds.ReadXml("\Program Files\MyProgram\MyData.xml")
"David Fúnez" <df****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
it doesn't work ....

Thanks anyway....

--
David Fúnez
Tegucigalpa, Honduras
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hi,

You have to specify the path for file.exists to work. Try
something
like this.

Dim strPath As String

strPath = System.IO.Path.GetDirectoryName( _

System.Reflection.Assembly.GetExecutingAssembly(). GetName().CodeBase)

Dim fXml As New FileInfo(strPath & "\config.xml")

Dim bXml As Boolean = fXml.Exists

If bXml Then

ds = New DataSet

ds.ReadXml(strPath & "\config.xml")

End If

Ken

--------------------

"David Fúnez" <df****@hotmail.com> wrote in message
news:eh****************@TK2MSFTNGP11.phx.gbl...
I have a little APP for an iPAQ that runs Ok but it does not show any
record, the problem is with the grid as shown, it has not a DATAMEMBER
Property to show the records.

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
'dgLibros.DataMember = "Prestados" ====> The problem

If File.Exists(xmlFile) Then
dsLibros.ReadXml(xmlFile)
End If
End Sub

Private Sub btnSalir_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSalir.Click
Me.Close()
End Sub

Private Sub btnSalvar_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSalvar.Click
dsLibros.WriteXml(xmlFile)
End Sub
--
David Fúnez
Tegucigalpa, Honduras


Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.