Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding data to a datatable

Status
Not open for further replies.

SBTBILL

Programmer
May 1, 2000
515
US
This is for a project to build an invoice.

I need to add data to an in memory table. I enter a line of data that includes two points where I do a post back. The first I enter an SKU in. I then get the description and price from a permanent SQL table. The next I enter a number and then compute the extended price.

The problem I have is I always loose everything but the current record.

I've checked and found that the datatable is reset each time. I define the datatable in the pageload sub. So I put in a flag to stop that. I was successful at that but now the table columns come up undefined. The appeared to have been defined on the first pass.

Anyhelp would be appreciated.
 
This sounds like web development, but given that you're doing the code behind in VB, it's probably alright.


You need to inspect the Page.IsPostBack in the Page_load event and build the columns on the first pass (Not Page.IsPostBack)
and then either way load the data, which you will probably have to store in session.

Lodlaiden

I haz all the letters: SME, BA, QA, PM, DEV, DBA, UAT, SE, HD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top