PC Review


Reply
Thread Tools Rate Thread

csharp skipping lines of code after a call...?

 
 
Alex
Guest
Posts: n/a
 
      14th Dec 2006

Hi -

I have some code that looks like this:

widget_DragDrop(object sender, DragEventArgs e)
{
//1. some business logic

dataobject_changedbvalues()

//2. some more business logic


}

dataobject_changedbvalues()
{
//set parms and execute a stored proc using

sqlCommand.ExecuteNonQuery();

}


When debugging, I can step through (1.) and the call to
dataobject_changedbvalues. The stored proc seems to execute correctly in
that it updates the specified values.

However, when I step off of that, it doesn't step to (2.) - control just
goes back to the event manager & (2.) is never executed.

What could be causing something like this? Lines in _changedbvalues after
the ExecuteNonQuery do execute so I don't think it's throwing an exception
or anything...???
 
Reply With Quote
 
 
 
 
Marc Gravell
Guest
Posts: n/a
 
      14th Dec 2006
Have you checked that you aren't throwing an exception somewhere? Also
: possibly a DoEvents() or similar pushing control back to the message
loop?

Marc

 
Reply With Quote
 
Alex
Guest
Posts: n/a
 
      15th Dec 2006
"Marc Gravell" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> Have you checked that you aren't throwing an exception somewhere? Also
>: possibly a DoEvents() or similar pushing control back to the message
> loop?
>
> Marc
>
>



You were right... I put it in a try/catch and it is throwing an
exception... trying to put a null from the proc into a csharp string.

Thanks!
 
Reply With Quote
 
jpuopolo
Guest
Posts: n/a
 
      15th Dec 2006
Marc makes a good point. Also, check to see if some of the code is
compiled in DEBUG mode vs. RELEASE. This can cause the debugger to jump
to "seemingly" random places.

jpuopolo

Alex wrote:
> Hi -
>
> I have some code that looks like this:
>
> widget_DragDrop(object sender, DragEventArgs e)
> {
> //1. some business logic
>
> dataobject_changedbvalues()
>
> //2. some more business logic
>
>
> }
>
> dataobject_changedbvalues()
> {
> //set parms and execute a stored proc using
>
> sqlCommand.ExecuteNonQuery();
>
> }
>
>
> When debugging, I can step through (1.) and the call to
> dataobject_changedbvalues. The stored proc seems to execute correctly in
> that it updates the specified values.
>
> However, when I step off of that, it doesn't step to (2.) - control just
> goes back to the event manager & (2.) is never executed.
>
> What could be causing something like this? Lines in _changedbvalues after
> the ExecuteNonQuery do execute so I don't think it's throwing an exception
> or anything...???


 
Reply With Quote
 
Duggi
Guest
Posts: n/a
 
      15th Dec 2006
Hi Alex

Its good practice to place try.. catch... finally block where ever the
control is going out of your code, I mean accessing third party code.
and also when resources are being accessed.

Thank you very much Marc, I learnt it... (I am also facing similar
situation and tried getting bottom of it for around 3-4 hours).

Thanks
-Srinvias.


Alex wrote:
> Hi -
>
> I have some code that looks like this:
>
> widget_DragDrop(object sender, DragEventArgs e)
> {
> //1. some business logic
>
> dataobject_changedbvalues()
>
> //2. some more business logic
>
>
> }
>
> dataobject_changedbvalues()
> {
> //set parms and execute a stored proc using
>
> sqlCommand.ExecuteNonQuery();
>
> }
>
>
> When debugging, I can step through (1.) and the call to
> dataobject_changedbvalues. The stored proc seems to execute correctly in
> that it updates the specified values.
>
> However, when I step off of that, it doesn't step to (2.) - control just
> goes back to the event manager & (2.) is never executed.
>
> What could be causing something like this? Lines in _changedbvalues after
> the ExecuteNonQuery do execute so I don't think it's throwing an exception
> or anything...???


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
csharp IDE long lines to code to multiline Peted Microsoft C# .NET 13 9th May 2007 03:54 PM
Urgent | How to call Delphi DLL using CSharp.Net Anoop Microsoft C# .NET 3 26th Oct 2006 02:01 PM
VBA Code skipping lines?? rblivewire@hotmail.com Microsoft Access Forms 0 1st Jun 2006 07:42 PM
skipping lines =?Utf-8?B?UHJvYmxlbSBmcm9tIHllc3RlcmRheQ==?= Microsoft Access Database Table Design 5 9th Jun 2004 01:31 AM
skipping lines amazin Microsoft Excel Misc 4 15th May 2004 03:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:01 AM.