473,761 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please help.. .can't make this work on win 2k3 (delegates related)

Hi, thanks for reading. I hope to find some help here
before I commit suicide because this is driving me crazy.

Please excuse me if this looks like a long post, but I
hope that a complete explanation help you to help
me :=) ....Let's start with some background:
..- I'm building an asp.net application that requires users
to upload text files in cvs format with data exported from
an AS-400.
..- The files will be something between 800kb and 2mb.
..- I have to parse those files, and get data to fill an
typed dataset.
..- I have to present dataset contents before submitting
anything to database
..- I'm stuck with only asp.net and sql server. I can't
build windows services, use msmq or anything else.

My biggest concern is that the browser can timeout before
i finish all processes. This is what I've done so far:

1.- Built a class that takes a file path as parameter in
the constructor. This class have the following method:
protected ArrayList getLines()

{

reader = File.OpenText(_ fileName);

ArrayList array = new ArrayList();

string str;

string[] valuesList;

do

{

str = reader.ReadLine ();

if(str!=null)

{

valuesList = str.Split(new char[] {';'});

array.Add(value sList);

}

}while(str!=nul l);

reader.Close();

return array;

}

As you can see, this base class handles the file itself,
converting the data to a more friendly arraylist

2.- Built a class that inherits the first class. This
class has a methos (the one that takes long) that iterates
thought all items in the ArrayList. I won't post the code
because is quite large but basicly it takes each item in
the array, examinate the data and invokes several methods
that create new rows inside dataset tables and fill them
with data. At the end returns the filled dataset. This
method recieve as parameter an instance of another class
that manages user data and permissions.

3.- In my web form I've done the following:
A.- declared an delegate (Nomisistemas.R eciept is the
typed dataset, "file" is the uploaded file
path, "Nomisistemas.N SWorker" is the instance of the class
that manages user data, "connectionStri ng" is the
connection string to the database.
public delegate Nomisistemas.Re ceipt testDelegate(st ring
file, Nomisistemas.NS Worker worker, string
connectionstrin g);

B.- in the web form Page_Load event handler i do:
(processReceipt File is a method that I'll explain later)
myDelegate = new testDelegate(th is.processRecei ptFile);

C.- The processReceiptF ile method is:
public Receipt processReceiptF ile2(string fileName,
NSWorker usrWorker, string connectionStrin g)

{

receiptsProcess or myReceipt = new receiptsProcess or
(fileName,usrWo rker,connection String);

return myReceipt.getRe ceiptsDataSet() ;

}

D.- In a button event handler, after i've managed the file
upload I do:
Session["Complete"] = false;

myDelegate.Begi nInvoke
(fileName,usrWo rker,connection String,new AsyncCallback
(myCallback),my Delegate);

Response.Redire ct("dataAdminRe ceipt.aspx");

E.- myCallback is:
public void myCallback(IAsy ncResult res)

{

testDelegate myDelegate = (testDelegate)
res.AsyncState;

Receipt ds = myDelegate.EndI nvoke(res);

Session["data"] = ds;

Session["Complete"] = true;

}

F.- In the dataAdminReceip t.aspx's Page_Load event handler
I'm doing:
if(!Page.IsPost Back)

{

if(!Convert.ToB oolean(Session["Complete"]))

{

Response.Write( "<META HTTP-EQUIV=Refresh
CONTENT='3; URL='>");

}

else

{

//Continue with the process....

}

}


So what I want to do is to lauch the delegate.BeginI nvoke
and go to another page to monitor the value of Session
["complete"], until is true. This idea is not mine, I'm
copying this from this tutorial .

So.. my problems.... This work great on my workstation
(windows xp pro sp1). Here everything run smothly.. But,
when I upload this app to a fresh installation of windows
2003 it fails. But doesn't throw any exception or
complains in anyway.. It just doesn't run. My session
variable never changes. And to make it worst, if I
implement a simpler application that uses this methodology
but doesn't use any of my custom objects IT WORKS ON THE
SERVER!.

I've tried to use threads directly, but also fails. Also
tried to serialize the dataset just to check if it has
something to do with Session variables, but also fails if
I'm doing it in the async way.. If i run it secuencially
(no delegates or threads) it also works in the server
(OMG!)

I've checked permissions, reinstalled the server, made
asp.net an administrator, impersonation to an
administrator, prayed to god and all angels, but no
sucess... any idea?.. please :'(

Thanks for reading again :).. I know you will show me the
light....
Nov 17 '05 #1
1 1459
"Esteban Felipe" <an*******@disc ussions.microso ft.com> wrote in message
news:08******** *************** *****@phx.gbl.. .
Hi, thanks for reading. I hope to find some help here
before I commit suicide because this is driving me crazy.


As soon as you call Response.Redire ct, the page you called it from is
destroyed, along with the Request, Response, Context and Server objects.
Since youd delegate is executing after all of this has been destroyed, it
will not have a pleasant time.
--
John Saunders
Internet Engineer
jo***********@s urfcontrol.com

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
3282
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application to create certain textboxes, labels, and combo boxes? Any ideas would be appreciated. Thanks
22
4070
by: Jeff Louie | last post by:
Well I wonder if my old brain can handle threading. Dose this code look reasonable. Regards, Jeff using System; using System.Diagnostics; using System.IO; using System.Threading;
29
1885
by: Brett | last post by:
I'd like to better understand how the following code works. I've posted questions below. namespace Something.Something1 { using System; public delegate void Test1(); public delegate void Test2(ink k);
8
1776
by: Nicky Smith | last post by:
Hello, I'm reading Mike Gunderloy's Mcad Vb.net book, and I've also read the MS press Mcad book for the same topic ".. Windows based applications with VB.net" for exam 70-306. In the sections in both books that try to teach the use of delagates and events, I'm really lost, and to make matters worse, I've written a user-control that fires events for the host form, and this works without delegates!
1
9651
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the best Newsgroup for support with JAVA?
53
4754
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code, and .Net2005 code. I'm developing in vb.net 2005. This test sub just reads an input text file, writing out records to another text file, eliminating records that have a '99' in them (it is similar to a CSV file). Some of my concerns are:
0
1092
by: Siegfried Heintze | last post by:
I'm practicing for the C# brain bench test by reviewing how delegates work. (Delegates are easy to to with visual studio because you normally use the delegates that some API as already defined. I'm worried they are going to make me do my own delegates from scratch.) I see that line 33 of Default.aspx is indeed executing when I single step with the debugger. As you can see (on lines of 17 and 18 of propertyDemo.cs I have set up a delegate...
13
1970
by: Praveen | last post by:
trying to learn plymorphism. My sample is public class Class1 { public static void Main(string args) { Cls1 x = new Cls1(); Cls2 y = new Cls2(); Cls3 y = new Cls3();
2
10043
by: hcaptech | last post by:
This is my Test.can you help me ? 1.Which of the following statement about C# varialble is incorrect ? A.A variable is a computer memory location identified by a unique name B.A variable's name is used to access and read the value stored in it C.A variable is allocated or deallocated in memory during runtime D.A variable can be initialized at the time of its creation or later 2. The.……types feature facilitates the definition of classes...
0
10111
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9948
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9902
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7327
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3866
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.