XML trouble still - Sorry for bothering u guys again 
Author Message
 XML trouble still - Sorry for bothering u guys again

I create a datatable, style e.t.c.  at the top of my form with the following
code.

Dim dtPickle As New DataTable("Pickle")
Dim dgTSPickle As New DataGridTableStyle()
Dim dgC1 As New DataGridTextBoxColumn()
Dim dgC2 As New DataGridTextBoxColumn()
Dim dgC3 As New DataGridTextBoxColumn()
Dim dgC4 As New DataGridTextBoxColumn()

I then create my columns, add theses to the datatable and make this table
the source of a datagrid (Simplified a little here to keep it short)

'Add columns to datatable
dtPickle.Columns.Add(New DataColumn("Code", GetType(String)))
Me.DataGrid2.DataSource = dtPickle
'Create column styles and add to TableStyle
Me.dgC1.MappingName = "Code"
Me.dgC1.Width = 60
Me.dgC1.HeaderText = "Code"
'Add column styles to TableStyle
Me.dgTSPickle.GridColumnStyles.Add(dgC1)
'Add TableStyle to Datagrid
Me.DataGrid2.TableStyles.Add(dgTSPickle)
Me.DataGrid2.Refresh()

I then add rows to the datatable

Dim rowP As DataRow
rowP = dtPickle.NewRow()
rowP(0) = Me.txtCode.Text

dtPickle.Rows.Add(rowP)

And then I create a dataset, add the table to the dataset and write the
contents to an XML file.

Dim ds As DataSet = New DataSet()
ds.Tables.Add(Me.dtPickle)
ds.WriteXml("C:\mydata.xml")

The XML file is Blank.
WHY ???????



Tue, 29 Mar 2005 20:28:16 GMT  
 XML trouble still - Sorry for bothering u guys again
Ive sorted it. A silly mistake.

Thanks all


Quote:
> I create a datatable, style e.t.c.  at the top of my form with the
following
> code.

> Dim dtPickle As New DataTable("Pickle")
> Dim dgTSPickle As New DataGridTableStyle()
> Dim dgC1 As New DataGridTextBoxColumn()
> Dim dgC2 As New DataGridTextBoxColumn()
> Dim dgC3 As New DataGridTextBoxColumn()
> Dim dgC4 As New DataGridTextBoxColumn()

> I then create my columns, add theses to the datatable and make this table
> the source of a datagrid (Simplified a little here to keep it short)

> 'Add columns to datatable
> dtPickle.Columns.Add(New DataColumn("Code", GetType(String)))
> Me.DataGrid2.DataSource = dtPickle
> 'Create column styles and add to TableStyle
> Me.dgC1.MappingName = "Code"
> Me.dgC1.Width = 60
> Me.dgC1.HeaderText = "Code"
> 'Add column styles to TableStyle
> Me.dgTSPickle.GridColumnStyles.Add(dgC1)
> 'Add TableStyle to Datagrid
> Me.DataGrid2.TableStyles.Add(dgTSPickle)
> Me.DataGrid2.Refresh()

> I then add rows to the datatable

> Dim rowP As DataRow
> rowP = dtPickle.NewRow()
> rowP(0) = Me.txtCode.Text

> dtPickle.Rows.Add(rowP)

> And then I create a dataset, add the table to the dataset and write the
> contents to an XML file.

> Dim ds As DataSet = New DataSet()
> ds.Tables.Add(Me.dtPickle)
> ds.WriteXml("C:\mydata.xml")

> The XML file is Blank.
> WHY ???????



Tue, 29 Mar 2005 20:52:12 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Sorry guys, will not commit this again

2. Sorry guys, will not commit this again

3. Sorry guys, will not commit this again

4. RegEx - sorry to bother - found the solution

5. Sorry to bother you but.....

6. ok guys com1 again

7. sorry but again: GUID and AUTONUMBER (not GUID only, not AUTONUMBER only, but both)

8. VB.NET vs C# (again, sorry!)

9. TEST TEST (Again - sorry)

10. Sorry Again about Rename

11. Vertical Text (Again - Sorry)

12. Hi Brownbear...sorry for disturbing everybody again.

 

 
Powered by phpBB® Forum Software