473,509 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML Writing and Reading

I am using the following code to write to an XML file

myXmlTextWriter.Formatting = System.Xml.Formatting.Indente
myXmlTextWriter.WriteStartElement("CPViewer"
myXmlTextWriter.WriteElementString("Height", InputBoxHeight
myXmlTextWriter.WriteElementString("Width", InputBoxWidth
'myXmlTextWriter.WriteElementString("Background", (OpenFileDialog1.FileName)
myXmlTextWriter.WriteElementString("label1.Top", label1.Top
myXmlTextWriter.WriteElementString("label1.Left", label1.Left
myXmlTextWriter.WriteElementString("label1.Height" , label1.Height
myXmlTextWriter.WriteElementString("label1.Width", label1.Width
myXmlTextWriter.WriteEndElement(
myXmlTextWriter.Flush(
myXmlTextWriter.Close(

Here is the XML output

<CPViewer><Height>600</Height><Width>800</Width><label1.Top>200</label1.Top><label1.Left>152</label1.Left><label1.Height>23</label1.Height><label1.Width>100</label1.Width></CPViewer

Here is the code from the reader

DataSet1.ReadXml("C:\CPViewer\LD.xml"
Me.DataBindings.Add(New Binding("Height", DataSet1, "CPViewer.Height")
Me.DataBindings.Add(New Binding("Width", DataSet1, "CPViewer.Width")
Me.DataBindings.Add(New Binding("label1.Top", DataSet1, "CPViewer.label1_Top")
'Me.DataBindings.Add(New Binding("BackgroundImage", DataSet1, "CPViewer.BackgroundImage")
Me.BackgroundImage = (Image.FromFile("C:\CPViewer\BackgroundImage.jpg")
Me.CenterToScreen(

When I try to read it in will will read the "Height" and "Width" lines and position the form properly but when it reads the "Label1.top" line I get the following error

An unhandled exception of type 'Syste,.ArgumentException' occurred i
system.windows.forms.dl

Additional Information: Cannot bind to property 'label1.Top' on target control

What am I missing here

Thank you
John
Nov 20 '05 #1
12 1460
Hi JCrouse,

I thought I adviced you to use the ds.xmlWrite and ds.xmlRead with that.

I used that method you are now using as well, however that is a lot more
work.

What is the reason you do not want to use that dataset method?

Cor
Nov 20 '05 #2
Hi,

Two things. First Your databinding code was wrong. Second Label1.Top
isn't a valid name use Label1_Top instead.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim ds As New DataSet

SaveData()
ds.ReadXml("C:\LD.xml")

Me.DataBindings.Add("Width", ds.Tables(0), "Width")
Me.DataBindings.Add("Height", ds.Tables(0), "Height")
Label1.DataBindings.Add("Top", ds.Tables(0), "Label1_Top")
Label1.DataBindings.Add("Left", ds.Tables(0), "Label1_Left")
Label1.DataBindings.Add("Width", ds.Tables(0), "Label1_Width")
Label1.DataBindings.Add("Height", ds.Tables(0), "Label1_Height")

End Sub

Private Sub SaveData()

Dim myXmlTextWriter As New Xml.XmlTextWriter("C:\LD.xml",
System.Text.Encoding.Unicode)

myXmlTextWriter.Formatting = System.Xml.Formatting.Indented
myXmlTextWriter.WriteStartElement("CPViewer")
myXmlTextWriter.WriteElementString("Height", "600")
myXmlTextWriter.WriteElementString("Width", "800")
'myXmlTextWriter.WriteElementString("Background",
(OpenFileDialog1.FileName))
myXmlTextWriter.WriteElementString("label1_Top", "200")
myXmlTextWriter.WriteElementString("label1_Left", "152")
myXmlTextWriter.WriteElementString("label1_Height" , "23")
myXmlTextWriter.WriteElementString("label1_Width", "100")
myXmlTextWriter.WriteEndElement()
myXmlTextWriter.Flush()
myXmlTextWriter.Close()
End Sub

Ken
--------------

--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.0.0 - Release Date: 6/2/2004
Nov 20 '05 #3
Hi John,

Thanks to the message from Ken, I am seeing now what you are doing.
(I did not look that far when I saw the XMLwriter.)

You try to write it using the XMLwriter and read it using the dataset.read
XML
(This part only is for the writing of the dataset, see for the reading Kens
message)

Try this
Dim ds as new dataset("CPViewer")
dim dt as new datatable("table1")
ds.tables.add(dt)
dt.columns.add("Height")
etc.
than you can do
dim dr as new datarow = dt.newrow

dr("Height") = InputBoxHeight.text
etc.

dt.add(dr)
ds.writeXML(path)

Maybe it looks more difficult, my expirience is that it is very easy to use.

Cor

Nov 20 '05 #4
Cor....I have no idea what your talking about. You must have me or my post confused with someone else

John
Nov 20 '05 #5
Hi John,

When I hadded sended it I thought that as well sorry, however see my other
post.

Cor
Nov 20 '05 #6
Well Cor....Here's the story. It doesn't seem to like the following line

Dim dr As New DataRow(dt.NewRow

It tells me that it is not accessable in this context because it is protected

Also, the following line has an error

dt.add(dt

It tells me that "add" is not a member of "system.data.datatable

What now
Joh

Nov 20 '05 #7
Hi John,
Well Cor....Here's the story. It doesn't seem to like the following line:

Dim dr As New DataRow(dt.NewRow) (I do really not know why I wrote this, this one does absolute not exist it
has to be)
dim dr as datarow = dt.newrow
Also, the following line has an error:
dt.add(dt)

I think a typo from you because I wrote
ds.add(dt)

I show it better to you

You declare the ds global because you need it probably in more places.
Private ds as dataset

Than in your load event of your form you check using the fileinfo if the
XMLfile exist.

When the file exist you do ds.readXML(filepath)

When not you create an empty dataset

ds = new dataset("CPViewer")
'this create an empty dataset
dim dt as new datatable("Form1")
'this create an empty table
ds.tables.add(dt)
'this set a referenence from the dataset to the table, as normaly is said
it places the table in the dataset.
dt.columns.add("Textbox1Height")
dt.columns.add("Textbox2Width")
'this add columns
You can create a lot of columns
And you create as well a lot of tables just as you like

To fill the items you do,
dim dr as datarow = ds.tables("Form1").newrow
dr("Height")=20
dr("Widht")=21
ds.tables("Form1").rows.add(dr)

I hope this goes better?

Cor
Nov 20 '05 #8
Cor....That's better. It seems to work now. Here is my code:

Dim ds As New DataSet("CPViewer")
Dim dt1 As New DataTable("P1JoyUp")
Dim dt2 As New DataTable("P1JoyLeft")
ds.Tables.Add(dt1)
dt1.Columns.Add("Height")
dt1.Columns.Add("Width")
ds.Tables.Add(dt2)
dt2.Columns.Add("Height")
dt2.Columns.Add("Width")

Dim dr1 As DataRow = ds.Tables("P1JoyUp").NewRow
dr1("Height") = lblP1JoyUp.Height
dr1("Width") = lblP1JoyUp.Width
Dim dr2 As DataRow = ds.Tables("P1JoyLeft").NewRow
dr2("Height") = lblP1JoyLeft.Width
dr2("Width") = lblP1JoyLeft.Width

ds.Tables("P1JoyUp").Rows.Add(dr1)
ds.Tables("P1JoyLeft").Rows.Add(dr2)

ds.WriteXml("C:\CPViewer\CPViewer.XML")

Now, how am I going to handle writing out the fore color, back color and font of the labels and the background image of the form? This was the part that gave me trouble before. Keep it simple, I'm a n00b.

Thank for your help,
John

"Cor Ligthert" wrote:
Hi John,
Well Cor....Here's the story. It doesn't seem to like the following line:

Dim dr As New DataRow(dt.NewRow)

(I do really not know why I wrote this, this one does absolute not exist it
has to be)
dim dr as datarow = dt.newrow
Also, the following line has an error:
dt.add(dt)

I think a typo from you because I wrote
ds.add(dt)

I show it better to you

You declare the ds global because you need it probably in more places.
Private ds as dataset

Than in your load event of your form you check using the fileinfo if the
XMLfile exist.

When the file exist you do ds.readXML(filepath)

When not you create an empty dataset

ds = new dataset("CPViewer")
'this create an empty dataset
dim dt as new datatable("Form1")
'this create an empty table
ds.tables.add(dt)
'this set a referenence from the dataset to the table, as normaly is said
it places the table in the dataset.
dt.columns.add("Textbox1Height")
dt.columns.add("Textbox2Width")
'this add columns
You can create a lot of columns
And you create as well a lot of tables just as you like

To fill the items you do,
dim dr as datarow = ds.tables("Form1").newrow
dr("Height")=20
dr("Widht")=21
ds.tables("Form1").rows.add(dr)

I hope this goes better?

Cor

Nov 20 '05 #9
Hi John,

You mean something as this
\\\
Dim label1fontcolor As String = Me.Label1.ForeColor.ToString
Dim label1font As String = Me.Label1.Font.ToString
Dim label1backcolor As String = Me.Label1.BackColor.ToString
///
You have to extract them of course to use them again, have as well a look at
the split for that.

I saw in other messages you are not using the background image as set in the
resource so I assume that is just saving the path.

I hope this helps?

Cor
Cor....That's better. It seems to work now. Here is my code: <...> Now, how am I going to handle writing out the fore color, back color and

font of the labels and the background image of the form? This was the part
that gave me trouble before. Keep it simple, I'm a n00b.
Nov 20 '05 #10
Well Cor. Time to get started on the reader part. I have pretty much
followed ALL you advice and now have an XML file. After I position all the
labels where I want them and set their properties I then open a
savefiledialog box and write out the xml file. Here it is:

<?xml version="1.0" standalone="yes" ?>
- <CPViewer>
- <P1JoyUp>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1JoyUp>
- <P1JoyRight>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1JoyRight>
- <P1JoyDown>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1JoyDown>
- <P1JoyLeft>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1JoyLeft>
- <P1B1>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1B1>
- <P1B2>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1B2>
- <P1B3>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1B3>
- <P1B4>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1B4>
- <P1B5>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1B5>
- <P1B6>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1B6>
- <P1B7>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1B7>
- <P1B8>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1B8>
- <P2JoyUp>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2JoyUp>
- <P2JoyRight>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2JoyRight>
- <P2JoyDown>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2JoyDown>
- <P2JoyLeft>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2JoyLeft>
- <P2B1>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2B1>
- <P2B2>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2B2>
- <P2B3>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2B3>
- <P2B4>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2B4>
- <P2B5>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2B5>
- <P2B6>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<ForeColor>Color [White]</ForeColor>
<Visible>False</Visible>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2B6>
- <P2B7>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2B7>
- <P2B8>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2B8>
- <P1JoyType>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P1JoyType>
- <P2JoyType>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</P2JoyType>
- <GameName>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</GameName>
- <NumPlayers>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</NumPlayers>
- <History>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</History>
- <Undocumented>
<Top>10</Top>
<Left>10</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>False</Visible>
<ForeColor>Color [White]</ForeColor>
<BackColor>Color [Transparent]</BackColor>
<Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=0,
GdiVerticalFont=False]</Font>
</Undocumented>
- <MainForm>
<Width>640</Width>
<Height>480</Height>
<Background>C:\CPViewer\BackgroundImage.jpg</Background>
</MainForm>
</CPViewer>

Now I want to be able to read it back in when I choose the xml file in my
openfiledialog box. It should then apply all of the settings in the xml
file. Get me started here. Give me some advice on how to start.

Thanks,
John


"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi John,

You mean something as this
\\\
Dim label1fontcolor As String = Me.Label1.ForeColor.ToString
Dim label1font As String = Me.Label1.Font.ToString
Dim label1backcolor As String = Me.Label1.BackColor.ToString
///
You have to extract them of course to use them again, have as well a look at the split for that.

I saw in other messages you are not using the background image as set in the resource so I assume that is just saving the path.

I hope this helps?

Cor
Cor....That's better. It seems to work now. Here is my code:

<...>
Now, how am I going to handle writing out the fore color, back color and

font of the labels and the background image of the form? This was the part
that gave me trouble before. Keep it simple, I'm a n00b.

Nov 20 '05 #11
Hi John,

I asume you did write it, I do not think you are able to serialize and show
it yet.
So therefore I think your question is something else than this.

Basicly it is
ds.WriteXML(at a place)
that you did
ds as new dataset
ds.ReadXML(at the same place)

Mystring as string = ds.tables("table1").Rows(0).("MyItem").ToString

And than you have to set thing, from which is the font difficult and the
hight easy.
I show only now the height after that reply again if you can not to the font
however try it first yourself, it cannot be that I write completly your
project.

label.height=CInt(Mystring)
This can of course as well in one time.

However you have to look every time to the right casting.

http://msdn.microsoft.com/library/de...conversion.asp

Cor

Well Cor. Time to get started on the reader part. I have pretty much
followed ALL you advice and now have an XML file. After I position all the
labels where I want them and set their properties I then open a
savefiledialog box and write out the xml file. Here it is:

Nov 20 '05 #12
All done Cor. I can now save a layout to xml and open a layout from xml. As
you mentioned the colors and font are a little trickier. I am trying to
figure out now how to read them back in since the are a string in the xml
file.

Thanks,
John

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Hi John,

I asume you did write it, I do not think you are able to serialize and show it yet.
So therefore I think your question is something else than this.

Basicly it is
ds.WriteXML(at a place)
that you did
ds as new dataset
ds.ReadXML(at the same place)

Mystring as string = ds.tables("table1").Rows(0).("MyItem").ToString

And than you have to set thing, from which is the font difficult and the
hight easy.
I show only now the height after that reply again if you can not to the font however try it first yourself, it cannot be that I write completly your
project.

label.height=CInt(Mystring)
This can of course as well in one time.

However you have to look every time to the right casting.

http://msdn.microsoft.com/library/de...conversion.asp
Cor

Well Cor. Time to get started on the reader part. I have pretty much
followed ALL you advice and now have an XML file. After I position all the labels where I want them and set their properties I then open a
savefiledialog box and write out the xml file. Here it is:


Nov 20 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3918
by: Google Mike | last post by:
Tell me if this can be done, and if I have a misconception here. I am writing an app that will be served up in an app farm, and therefore I need to move the session information to the client, not...
6
23556
by: Sebastian Kemi | last post by:
How should a write a class to a file? Would this example work: object *myobject = 0; tfile.write(reinterpret_cast<char *>(myobject), sizeof(*object)); / sebek
4
2072
by: Mark Stijnman | last post by:
A while ago I posted a question about how to get operator behave differently for reading and writing. I basically wanted to make a vector that can be queried about whether it is modified recently...
9
2927
by: 100 | last post by:
Has anybody read Steve Maguire's book "Writing solid code"? Do you think that the ideas in this book are not applicable in c# language? Does anybody find if(2 == i) istead of if(i == 2) as...
2
2003
by: John Salerno | last post by:
I wrote this code just to experiment with writing to and reading from a file. It seems to work fine when writing, but when reading the file, it only prints the filepath to the screen, not the file...
5
5056
by: UJ | last post by:
I have a system that has five programs that all communicate with each other via Message Queues. Works well. One program is a watchdog that will make sure the others are up and going. Currently I...
16
7152
by: Claudio Grondi | last post by:
I have a 250 Gbyte file (occupies the whole hard drive space) and want to change only eight bytes in this file at a given offset of appr. 200 Gbyte (all other data in that file should remain...
6
5244
by: arne.muller | last post by:
Hello, I've come across some problems reading strucutres from binary files. Basically I've some strutures typedef struct { int i; double x; int n; double *mz;
3
2290
by: fuenfzig | last post by:
Hi all, I want to use a single std::stringbuf for writing (by a std::ostream) and for reading (by a std::istream), concurrently in two threads. This came to my mind, because the code for reading...
42
4821
by: psbasha | last post by:
Hi, Is it necessary in Python to close the File after reading or writing the data to file?.While refering to Python material ,I saw some where mentioning that no need to close the file.Correct me...
0
7135
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7410
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7067
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
440
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.