473,395 Members | 2,783 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,395 software developers and data experts.

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


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...???
Dec 14 '06 #1
4 3085
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

Dec 14 '06 #2
"Marc Gravell" <ma**********@gmail.comwrote in
news:11*********************@f1g2000cwa.googlegrou ps.com:
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!
Dec 15 '06 #3
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...???
Dec 15 '06 #4
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...???
Dec 15 '06 #5

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

Similar topics

9
by: Chuck Anderson | last post by:
I have a function with 7 inputs. The last three have default values. I want to call that function specifying the first four, skip two and then specify the last. I thought I could write this...
5
by: Geoff Bennett | last post by:
While parsing an XML document, my TextReader instance skips nodes. For example, in this fragment: <Person Sex="Male" FirstHomeBuyer="No" YearsInCurrentProfession="14"> <RelatedEntityRef...
3
by: Ivan Liu | last post by:
I would like know how I can skip a line while reading a set of input data (from a text file) if the first character of the line is "#". My original code reads: ifstream Infile("data.dat"); ...
6
by: lisa.engblom | last post by:
Hi, I've just started programming in python, and have run into an unexpected problem. I am using python to pull text data from some csv files. I have one file that has the important...
19
by: auratius | last post by:
http://www.auratius.co.za/CSharpCodingStandards.html Complete CSharp Coding Standards 1. Naming Conventions and Styles 2. Coding Practices 3. Project Settings and Project Structure 4....
7
by: Gustaf | last post by:
Hi all, Just for fun, I'm working on a script to count the number of lines in source files. Some lines are auto-generated (by the IDE) and shouldn't be counted. The auto-generated part of files...
0
by: Jerry Coffin | last post by:
In article <4fae62b0-6858-4e9e-830e-9eecf6691d4a@ 59g2000hsb.googlegroups.com>, friend.blah@googlemail.com says... Each time you read from the file, keep track of the file position after...
4
by: BibI | last post by:
Hi there, I just started programming with PERL and am trying to put together my first little data manipulation program. I am working on a MAC with OSX. I have a data file with the following...
3
by: =?Utf-8?B?R3JlZw==?= | last post by:
I''ve been working with a CSharp web-site (and am new to it). I have a javascript function that accepts variables from my CSharp code. It all works fine, with the exception of one variable type. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.