Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / October 2004

Tip: Looking for answers? Try searching our database.

exception error when closing app

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ron - 22 Oct 2004 21:28 GMT
my application is throwing an exception error when closing
if I run a procedure in the app.  I can't even trap the
error with try/catch ex As Exception.  Is there a way to
completely shut down the app through code?  I am using

End

for now.  Is there a way I can suppress this exception
message?  The app gets invoked programmatically on a
schedule.  So no one would be around to click off the
error message.

Thanks
Bernie Yaeger - 22 Oct 2004 21:38 GMT
Hi,

How do you close the app?  Have you tried
Application.Exit()

HTH,

Bernie Yaeger

> my application is throwing an exception error when closing
> if I run a procedure in the app.  I can't even trap the
[quoted text clipped - 9 lines]
>
> Thanks
Ron - 22 Oct 2004 22:13 GMT
No.  But I am pretty sure that is what I was looking for.

Thanks.

>-----Original Message-----
>Hi,
[quoted text clipped - 21 lines]
>
>.
Herfried K. Wagner [MVP] - 22 Oct 2004 22:25 GMT
"Ron" <anonymous@discussions.microsoft.com> schrieb:
> my application is throwing an exception error when closing
> if I run a procedure in the app.  I can't even trap the
[quoted text clipped - 4 lines]
>
> for now.

What exception?

Notice that 'End' or 'Application.Exit' is not the best choice.  Instead,
simply close the main form by calling its 'Close' method.

Signature

Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/

Ron - 22 Oct 2004 23:33 GMT
Thank you.  I changed it to Me.Close.  But I still get the
Application error when I invoke the app from another app.  
The error is

Application Error
The instruction at "0x7923302d" referenced memor
at "0x00219404", the memory could nto be read".

I am running a DTS package from vb.net.  I was having
problems running the package from the original app so I
created a separate app that I start with
system.diagnostics.process.start(app, args) from the
original app.  The 2nd app only runs DTS.

Then the DTS app is supposed to close itself.  But I keep
getting the error above when I run the DTS package
procedure.  If I don't run the DTS package then the DTS
app closes correctly.  Note:  the DTS package runs fine,
but something is getting set by the DTS procedure at the
system level.    I wish I knew what it was so I could
reset it.

Ron

>-----Original Message-----
>"Ron" <anonymous@discussions.microsoft.com> schrieb:
[quoted text clipped - 11 lines]
>Notice that 'End' or 'Application.Exit' is not the best choice.  Instead,
>simply close the main form by calling its 'Close' method.
Ron - 23 Oct 2004 00:03 GMT
OK.  I think I fixed (I hope!).  I moved the Me.Close
statement out of the DTS package procedure and into a
Timer procedure.  Apparently, the DTS package is very
touchy and does not want to perform anything else that is
not part of the DTS Package.  Man, I can't wait for
ADO.net2 (note:  I use DTS because I am moving a few gigs
of data - daily - of course, for the test purpose, each
textfile DTS is reading only contains 100 records right
now).

>-----Original Message-----
>Thank you.  I changed it to Me.Close.  But I still get the
[quoted text clipped - 40 lines]
>>
>.
CJ Taylor - 23 Oct 2004 01:01 GMT
What kind of package are you running?  Bulk insert?
> OK.  I think I fixed (I hope!).  I moved the Me.Close
> statement out of the DTS package procedure and into a
[quoted text clipped - 53 lines]
>>>
>>.
Ron - 23 Oct 2004 08:15 GMT
Yes, bulk insert.  Originally, I was using vb6 and pulling
data from an external data source (non rdbms) and writing
each record to sql server record by record.  It started
taking too long (several hours) and was becoming
unreliable, connection open too long.  So with vb.net, I
read each record and write it to a series of text files
(each text file will contain at most 20,000 records).  I
write close to 100 textfiles (nearly 2,000,000 records).  
Then I suck em all up with DTS - takes only 2-3 minutes
with vb.net.  The suggestion of using the DTS Agent is
that I have nearly 100 text files to import.  I loop
through my DTS package in the vb.net app.  Much easier
than using the agent.  The new system takes between 1 to 1
½ hrs.  Way more reliable because writing text files is a
snap with vb.net.  Plus, vb.net runs the DTS package 3-4
times faster than vb6

But I understand that ado.net2 will have bulk insert
capabilities similar to DTS.  I sure hope that is true.  I
believe that DTS packages are hard to deal with because
they are basically com based, I mean I have to make a
reference to DTS package Object Library from the com tab
in references.

>-----Original Message-----
>What kind of package are you running?  Bulk insert?
[quoted text clipped - 57 lines]
>
>.
CJ Taylor - 23 Oct 2004 19:53 GMT
We did something similiar at work (Bulk Insert doing about 140,000 records)
and was running through the same issues.  I was originally trying to use the
BCP program and shell out to that, but became too unreliable and couldn't
manage events that would happen (out of 140,000 rows 2 would fail, I know
you can keep going but I needed to inform the user immediatly).

What we ended up doing was using the COM object for SQL DMO (I *think*
that's the library) and this worked AWESOME!  Good event model on when it
inserts rows, good documentation and you run it in process so you could keep
an eye on everything going on.  140,000 records took roughly 30 seconds
doing it this way.  The whole procedure took 15 minutes, 13 of that to
generate the XML file from this proprietary language called guru, 1.5
minutes for the XML DOM parser to read it in, and 2 seconds for the XSLT
transform, and 30 for the insert.

So check out the COM object, you'll find it really easy to use and easier to
debug/work with.

HTH,
CJ

Yes, bulk insert.  Originally, I was using vb6 and pulling
data from an external data source (non rdbms) and writing
each record to sql server record by record.  It started
taking too long (several hours) and was becoming
unreliable, connection open too long.  So with vb.net, I
read each record and write it to a series of text files
(each text file will contain at most 20,000 records).  I
write close to 100 textfiles (nearly 2,000,000 records).
Then I suck em all up with DTS - takes only 2-3 minutes
with vb.net.  The suggestion of using the DTS Agent is
that I have nearly 100 text files to import.  I loop
through my DTS package in the vb.net app.  Much easier
than using the agent.  The new system takes between 1 to 1
? hrs.  Way more reliable because writing text files is a
snap with vb.net.  Plus, vb.net runs the DTS package 3-4
times faster than vb6

But I understand that ado.net2 will have bulk insert
capabilities similar to DTS.  I sure hope that is true.  I
believe that DTS packages are hard to deal with because
they are basically com based, I mean I have to make a
reference to DTS package Object Library from the com tab
in references.

>-----Original Message-----
>What kind of package are you running?  Bulk insert?
>"Ron" <anonymous@discussions.microsoft.com> wrote in
message
>news:066801c4b88b$498f9cd0$a501280a@phx.gbl...
>> OK.  I think I fixed (I hope!).  I moved the Me.Close
>> statement out of the DTS package procedure and into a
>> Timer procedure.  Apparently, the DTS package is very
>> touchy and does not want to perform anything else that
is
>> not part of the DTS Package.  Man, I can't wait for
>> ADO.net2 (note:  I use DTS because I am moving a few
gigs
>> of data - daily - of course, for the test purpose, each
>> textfile DTS is reading only contains 100 records right
[quoted text clipped - 18 lines]
>>>
>>>Then the DTS app is supposed to close itself.  But I
keep
>>>getting the error above when I run the DTS package
>>>procedure.  If I don't run the DTS package then the DTS
[quoted text clipped - 10 lines]
>>>closing
>>>>> if I run a procedure in the app.  I can't even trap
the
>>>>> error with try/catch ex As Exception.  Is there a way
>> to
>>>>> completely shut down the app through code?  I am
using

>>>>> End
>>>>>
[quoted text clipped - 5 lines]
>>>choice.  Instead,
>>>>simply close the main form by calling its 'Close'
method.

>>>.
>
>.
Bernie Yaeger - 23 Oct 2004 01:36 GMT
Hi Ron,

I run DTS packages through the sql server agent.  It runs the package and
closes itself without incident.  I see that you may have the problem solved,
so that's what counts; but if you don't, you may want to use sql server's
server agent for this.

HTH,

Bernie

> Thank you.  I changed it to Me.Close.  But I still get the
> Application error when I invoke the app from another app.
[quoted text clipped - 37 lines]
> choice.  Instead,
>>simply close the main form by calling its 'Close' method.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.