Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: DataTable


Message #1 by "yvonne" <yvonne.dickson@p...> on Fri, 1 Mar 2002 15:12:40
Hi



Every time I add a new row to a datatable, it over writes the data that I 

have already initialised it with.



I want to add to a datatable throughout the events of a page.  Is this 

possible



Cheers
Message #2 by "Lauser, John" <LauserJ@h...> on Mon, 4 Mar 2002 09:41:27 -0500
What language are you using and how are you currently trying to add

rows?



John



-----Original Message-----

From: yvonne [mailto:yvonne.dickson@p...]

Sent: Friday, March 01, 2002 10:13

To: ASP+

Subject: [aspx] DataTable





Hi



Every time I add a new row to a datatable, it over writes the data that

I

have already initialised it with.



I want to add to a datatable throughout the events of a page.  Is this

possible



Cheers




Message #3 by Yvonne Dickson <Yvonne.Dickson@p...> on Mon, 4 Mar 2002 15:23:08 -0000
Hi John,



I am using VB.  I want to capture details of a very long user input

scenario(form).  This scenario can be repeated.  For each scenario(form) I

want to add the information in the form of datarow to a datatable and persit

the whole event in a dataset.



At the end of the session, the user can modify the data in the dataset

before doing a bulk insert to a database.



Unfortunatly, I am in the process of installing the release VS.net.  So far

it has taken all day to get rid of beta 2.  I do not have access to my code,

however it is taken from wrox and goes similar to this :- 



Dim dt as new datatable

Dim dr as datarow



Dt.columns.add("colnameone", system.type.getType("system.string")

Dt.columns...........

Dt.columns...........



Dr=dt.newRow()

Dr("columnOne ")="Data Item one"

Dr...........

Dr..........



Dt.Rows.Add(dr)



Above defines the dataTable and rows to add, I add a few first time round.

I then add this table to a dataSet and bind it to a grid.  This works fine,

however on the post back I am trying to add another datarow to the datatable

in the dataSet.  When I bind the datagrid the initial values are lost and I

am left with just the last entry.





Hope you can  help, meanwhile back to installing VS.Net



Cheers

Yvonne





-----Original Message-----

From: Lauser, John [mailto:LauserJ@h...] 

Sent: 04 March 2002 14:41

To: ASP+

Subject: [aspx] RE: DataTable



What language are you using and how are you currently trying to add

rows?



John



-----Original Message-----

From: yvonne [mailto:yvonne.dickson@p...]

Sent: Friday, March 01, 2002 10:13

To: ASP+

Subject: [aspx] DataTable





Hi



Every time I add a new row to a datatable, it over writes the data that

I 

have already initialised it with.



I want to add to a datatable throughout the events of a page.  Is this 

possible



Cheers










  Return to Index