Solved

Problem with DataTable

Posted on 2004-08-25
4
334 Views
Last Modified: 2010-04-15
Hello, I'm getting data via an excel file that the user will upload through my application. I do not want to save the file, only grab the information (address book) and display with editable capabilities, so they can change errors I flag prior to submitting the information to the database.

I've built a wrapper class to represent an Address from the file. I get the information, put it into an array using my class (because I will want to do lots of checking the data), create a DataTable, and iterate through the array therby inserting each row into my memory table. (I'm also doing it this way because I want to add an auto incrimented field to reference each row)

I am able to do all this, display the data and I even understand how to make changes to it uses a postback method from this page, however what I really want to do is have the edit button pop-up a seperate window containing only the data corresponding to the ID from the DataTable row. Problem is I don't seem to have access to this data anymore on the new page...I thought that I DataTable was in the memory?!?!? Or is it only in memory for the original page? And if that's true, how does that page when it's refreshed still access the data in a way that a new page cannot?

It's too mush code to list here, and besides the data table works properly on the one page...I guess I'm just wondering why I don't have access to it elsewhere if it's in memory. Someone please help to explain. This is getting to be a very time sensitive matter for me.

thanks in advance!!
0
Comment
Question by:animated405
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
123654789987 earned 250 total points
ID: 11899889
In a Web form it is able to use some kind of memory management to save the data of any of its control. But when u migrate to a different page this data is lost from memory. To store this data u have to explicitely cache the data or use Session to hold the data between forms.
0
 

Author Comment

by:animated405
ID: 11899936

thanks for the reply. So, basically on my first page I have to make the DataTable, populate it with my Data, then cache it. Then on my second page I have to grab it from memory, make a new datatable, repopulate it in order to get a specific row and edit that information, then reset it back to memory again so that when I return to the original page I can refresh with the updated data that was just put back into memory?

What do you mean explicitly cache the data or use session, what other method of caching the data is there besides using the session, hashtable or application states? And also, I haven't tried this but can you iterate through the cached session data just like you could through an array or something?

thanks again!!
0
 
LVL 5

Assisted Solution

by:jjacksn
jjacksn earned 250 total points
ID: 11899991
Session variable, animated, is what you had before

Session["yourvar"] = blah.

0
 

Author Comment

by:animated405
ID: 11902707

Thanks very much for your comments, not sure what to do so I'm splitting the points.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Change to file doesn't show up 16 93
ASP.NET data base connection 35 94
Using the .NET JSON Serializer to create a single string 6 57
VS C# how to design libary of functions 7 33
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question