Re: inputing, paging, sorting, a large text file



Looks like storing it in a temp table in the database may be the way to go
then,
Thanks,
JJ

"Peter Bromberg [C# MVP]" <pbromberg@xxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:FAC4AE1D-8065-4EC2-84A3-07FC01C0AFBC@xxxxxxxxxxxxxxxx
As Alexey said. A 3000 line text file (or the DataTable you get from
converting it) isn't going to bring down your server. But, if it is
user-specific and you have to use Session, and you have a lot of users,
well
- you can do the math.
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net




"JJ" wrote:

Is there a limit to how large the datatable can be within a Session
variable? We're talking a 3000 line tab delimited text file here.

JJ

"Peter Bromberg [C# MVP]" <pbromberg@xxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:6307AD3D-519F-4271-9F6C-6852968C4465@xxxxxxxxxxxxxxxx
Store the DataTable in Session after you've first constructed it.
Get it back out of Session after changing the PageIndex and rebind:

grid.CurrrentPageIndex =e.newPageIndex;
DataTable myTable = (DataTable)Session["myDataTable"];
grid.DataSource=myTable;
grid.DataBind();

Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net




"JJ" wrote:

Hi Peter,

Thats what I've done (used a dataTable that is). But I notice, unless
I'm
mistaken, that each time you change the page index, you need to rebind
the
grid to the datatable. I lose the contents of that datatable on each
refresh. To recreate it I need to parse the text again, which will be
a
lengthy process if the text file is 3000 lines.

I'm therefore at a loss as to how to keep hold of the large, formatted
datatable throughout postbacks.
Could I write the gridview as a user control and use viewstate for
such a
large datatable perhaps?

JJ

<pbromberg@xxxxxxxxx> wrote in message
news:1181238036.929293.116830@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jun 7, 11:56 am, "JJ" <a...@xxxxxxx> wrote:
I have a need to input a large tab delimited text file, which I
will
parse
to check it has the expected columns, before allowing the user to
submit
it
to the database. The user may paste the file into a textbox, or
upload
it
(haven't decided yet).

The problem I have is that the text file consists of around 3000
lines,
and
I want to display the formatted columns to the user before
submitting
it
to
the database (perhaps allowing them to edit some fields if they
want,
before
clicking submit).
Clearly 3000 lines is too much to display on one gridview page - so
the
question is::

How can I page the data in the grid, without having to parse the
text
each
time - i.e. where can I 'store' the parsed text so that I use that
during
my
paging operations (prior to inserting it into the database)?

Thanks,
JJ

JJ,
What I'd consider doing is to read and parse the file into a
DataTable, and use this to bind to a pageable grid.
Peter









.



Relevant Pages

  • Re: inputing, paging, sorting, a large text file
    ... Is there a limit to how large the datatable can be within a Session ... To recreate it I need to parse the text again, ... the database (perhaps allowing them to edit some fields if they want, ... How can I page the data in the grid, without having to parse the text ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Architectural advice needed on client-side browser scripting
    ... can easily serialize a DataTable (in this case the INFORMATION_SCHEMA views ... easily parse that XML to load listboxes or arrays. ... on a database chosen parse it for all tables in this database ... list all tables in the chosen database as interactive interface ...
    (comp.lang.javascript)
  • Re: Parsing and storing formulas
    ... you could easily store different views/stored ... >I was wondering how I can parse a mathematical formula in a storable way. ... > be stored for in the database. ... > The second idea is to represent the formula as a tree. ...
    (microsoft.public.dotnet.languages.csharp)
  • inputing, paging, sorting, a large text file
    ... I have a need to input a large tab delimited text file, which I will parse ... to check it has the expected columns, before allowing the user to submit it ... I want to display the formatted columns to the user before submitting it to ... the database (perhaps allowing them to edit some fields if they want, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Datagrid Issues
    ... I subclassed the grid and that seemed to work, ... > a row in the datagrid by clicking on the row header and pressing the Delete ... > call to the database and check a couple things, if the method that calls the ... > message and then I want the row to not be removed from display in the ...
    (microsoft.public.dotnet.framework.windowsforms)

Loading