473,382 Members | 1,086 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

C# forms - this.dispose? want to close automatically when done.

Dear Readers,

I have successfully created a C# program that will load records from a
view, do some processing, write them back. I want to do this in an
unattended mode.

I want to close the program once the processing of the 500-odd records
are done.

private void frmGeoCode_Load(object sender, System.EventArgs e)
{
LoadRecords();
sendXMLToSERVER();
this.Dispose();
}

when I put a break point on this.Dispose and step through it, the
application stops.

right now, it is on my workstation - can I work on other things when
this is processing in the Visual Studio.NET IDE.

any ideas will be greatly helpful.

Objective:
1. want to run this program every 3 hours on the server; want to grab
the records from a view and process them till they are done.

thanks and regards
Ravi.
Nov 16 '05 #1
2 12774
In general there's no reason to call Dispose on your Form object. Have you
tried this.Close when you want the form to close?

Does this app need a UI anyway? Why not just a command line app with a
simple Main method? Really it sounds like a candidate to be a Windows
Service that runs forever and sleeps for 3 hours between batches.

Brad Williams
"Ravichandran Mahalingam" <mr***********@Hotmail.com> wrote in message
news:28**************************@posting.google.c om...
Dear Readers,

I have successfully created a C# program that will load records from a
view, do some processing, write them back. I want to do this in an
unattended mode.

I want to close the program once the processing of the 500-odd records
are done.

private void frmGeoCode_Load(object sender, System.EventArgs e)
{
LoadRecords();
sendXMLToSERVER();
this.Dispose();
}

when I put a break point on this.Dispose and step through it, the
application stops.

right now, it is on my workstation - can I work on other things when
this is processing in the Visual Studio.NET IDE.

any ideas will be greatly helpful.

Objective:
1. want to run this program every 3 hours on the server; want to grab
the records from a view and process them till they are done.

thanks and regards
Ravi.

Nov 16 '05 #2
Thanks Mr. Brad,

i will use that additional line mentioned in your statement.

I could have chosen 'A Console Application' and things would have easier
with that.

thanks and regards
Ravi.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3

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

Similar topics

3
by: Joshua Russell | last post by:
Hi, Both the methods below open up a windows form called MasterForm. However, one works better than the other. Method 1 opens the form correctly but I don't have any reference to the instance of...
6
by: Ayende Rahien | last post by:
Excetremely annoying problem, I've an application with a long startup time. So I created another form with my logo in it to as a splash screen. The splash screen is run from another thread and is...
0
by: Andrew Dowding | last post by:
Hi Everybody, I have been looking at problems with my Windows Forms C# application and it's little Jet 4 (Access) database for the last few days. The Windows Forms app implements a facade and...
16
by: Daniel Mori | last post by:
If an object implements the IDisposable interface (regardless if its a framework object or a user object), should I always dispose of that object out of principle?
15
by: Joshua Kendall | last post by:
I have a script in which it keeps opening the same form instead of only one instance. I also need help with a form that has a password. Where do I put the actual password? can I use a database for...
4
by: Anthony Nystrom | last post by:
Anytime I close a form should I also dispose such as me.clos me.dispos What else Should I dispose... If I set a var to nothing should I also dispose such as f = nothin f.dispos
4
by: JS | last post by:
I have an application with many user controls and forms which display measurements in whatever the current unit system is. The current unit system is kept in my 'Units' static class as...
8
by: AAaron123 | last post by:
If I show a form with ShowDialog and Dispose it FormClosing does not appear to run. At least I think that is true. If I want FormClosing and FormClose to run am I suppose to call the forms...
2
by: =?Utf-8?B?RXRoYW4gU3RyYXVzcw==?= | last post by:
I am (still) relatively new to Windows applications, most of my experience has been Web based, and I am confused about what exactly happens when the Main() method is called and how to manipulate...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.