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

question about spaces in name

ST
Can anyone tell me why the code below won't work for me? It's not picking up
the results from the "OTHER" sections of "General Developmental" and "LAB
TEST RESULTS". Because the OTHER section worked for "Musculoskeletal", I
have a feeling this is a result of the values for that column (General
Developmental, and LAB TEST RESULTS) have spaces in them. Can anyone help me
get around this without having to change all the values in the SQL database?

'Musculoskeletal Symptoms
Case "Scoliosis"
If Not dr("CHOICE").ToString = "NA" Then
lblMS_S.Text = dr("CHOICE").ToString.ToUpper
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA" Then
lblMS_S_F.Text =
dr("IS_FAMILY_HISTORY").ToString.ToUpper
End If
Case "Achilles Tendon Contractures"
If Not dr("CHOICE").ToString = "NA" Then
lblMS_ATC.Text = dr("CHOICE").ToString.ToUpper
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA" Then
lblMS_ATC_F.Text =
dr("IS_FAMILY_HISTORY").ToString.ToUpper
End If
Case "Knee Contractures"
If Not dr("CHOICE").ToString = "NA" Then
lblMS_KC.Text = dr("CHOICE").ToString.ToUpper
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA" Then
lblMS_KC_F.Text =
dr("IS_FAMILY_HISTORY").ToString.ToUpper
End If
Case "ELBOW Contractures"
If Not dr("CHOICE").ToString = "NA" Then
lblMS_EC.Text = dr("CHOICE").ToString.ToUpper
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA" Then
lblMS_EC_F.Text =
dr("IS_FAMILY_HISTORY").ToString.ToUpper
End If
Case "NECK Contractures"
If Not dr("CHOICE").ToString = "NA" Then
lblMS_NC.Text = dr("CHOICE").ToString.ToUpper
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA" Then
lblMS_NC_F.Text =
dr("IS_FAMILY_HISTORY").ToString.ToUpper
End If

****HERE IT WORKS!***
Case "OTHER"
If dr("MAIN_CATEGORY") = "Musculoskeletal" Then
If Not dr("CHOICE").ToString = "NA" Then
lblMS_O.Text = dr("CHOICE").ToString.ToUpper
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA"
Then
lblMS_O_F.Text =
dr("IS_FAMILY_HISTORY").ToString.ToUpper
End If
End If
'General Developmental
Case "Language Delay"
If Not dr("CHOICE").ToString = "NA" Then
lblGD_LA.Text = dr("CHOICE").ToString.ToUpper
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA" Then
lblGD_LA_F.Text =
dr("IS_FAMILY_HISTORY").ToString.ToUpper
End If
Case "Learning Disability"
If Not dr("CHOICE").ToString = "NA" Then
lblGD_LE.Text = dr("CHOICE").ToString.ToUpper
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA" Then
lblGD_LE_F.Text =
dr("IS_FAMILY_HISTORY").ToString.ToUpper
End If
Case "ADHD/ADD"
If Not dr("CHOICE").ToString = "NA" Then
lblGD_AD.Text = dr("CHOICE").ToString.ToUpper
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA" Then
lblGD_AD_F.Text =
dr("IS_FAMILY_HISTORY").ToString.ToUpper
End If
Case "Behavioral Problems"
If Not dr("CHOICE").ToString = "NA" Then
lblGD_BP.Text = dr("CHOICE").ToString.ToUpper
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA" Then
lblGD_BP_F.Text =
dr("IS_FAMILY_HISTORY").ToString.ToUpper
End If

****HERE IT DOES NOT WORK!!!********
Case "OTHER"
If dr("MAIN_CATEGORY").ToString = "General
Developmental" Then
If Not dr("CHOICE").ToString = "NA" Then
lblMS_O.Text = dr("CHOICE").ToString.ToUpper
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA"
Then
lblMS_O_F.Text =
dr("IS_FAMILY_HISTORY").ToString.ToUpper

End If
End If
'Lab Test Results
Case "Elevated Transaminases"
If Not dr("CHOICE").ToString = "NA" Then
lblLTR_ET.Text = dr("CHOICE")
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA" Then
lblLTR_ET_F.Text = dr("IS_FAMILY_HISTORY")
End If
Case "Aldolase"
If Not dr("CHOICE").ToString = "NA" Then
lblLTR_A.Text = dr("CHOICE")
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA" Then
lblLTR_A_F.Text = dr("IS_FAMILY_HISTORY")
End If

****HERE IT DOES NOT WORK!!!*****
Case "OTHER"
If dr("MAIN_CATEGORY").ToString = "LAB TEST RESULTS"
Then
If Not dr("CHOICE").ToString = "NA" Then
lblLTR_O.Text = dr("CHOICE").ToString.ToUpper
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA"
Then
lblLTR_O_F.Text =
dr("IS_FAMILY_HISTORY").ToString.ToUpper
End If
End If

Case "MAX CPK 1ST VALUE"
If Not dr("CHOICE").ToString = "NA" Then
lblLTR_CPK1.Text = dr("CHOICE")
End If
Case "MAX CPK 2ND VALUE"
If Not dr("CHOICE").ToString = "NA" Then
lblLTR_CPK2.Text = dr("CHOICE")
End If

End Select

If dr("VALUE_ID").ToString = "CVID-502" Then
If dr("CLINICAL_VALUE_OTHER_NOTE").ToString = "" Then
lblVS_O_Text.Text = ""
Else
lblVS_O_Text.Text =
dr("CLINICAL_VALUE_OTHER_NOTE").ToString
End If
End If
If dr("VALUE_ID").ToString = "CVID-500" Then
If dr("CLINICAL_VALUE_OTHER_NOTE").ToString = "" Then
lblMS_O_Text.Text = ""
Else
lblMS_O_Text.Text =
dr("CLINICAL_VALUE_OTHER_NOTE").ToString
End If
End If
If dr("VALUE_ID").ToString = "CVID-504" Then
If dr("CLINICAL_VALUE_OTHER_NOTE").ToString = "" Then
lblGD_O_Text.Text = ""
Else
lblGD_O_Text.Text =
dr("CLINICAL_VALUE_OTHER_NOTE").ToString
End If
End If
If dr("VALUE_ID").ToString = "CVID-506" Then
If dr("CLINICAL_VALUE_OTHER_NOTE").ToString = "" Then
lblLTR_O_Text.Text = ""
Else
lblLTR_O_Text.Text =
dr("CLINICAL_VALUE_OTHER_NOTE").ToString
End If
End If

Next
Catch err As SqlException
Dim sqlerr As String = err.Message
End Try
tblSymptoms.Visible = True
lkbSymDown.Visible = True
lkbSymUp.Visible = False

End Sub
Jul 21 '05 #1
9 1145
ST <ST@discussions.microsoft.com> wrote:
Can anyone tell me why the code below won't work for me? It's not picking up
the results from the "OTHER" sections of "General Developmental" and "LAB
TEST RESULTS". Because the OTHER section worked for "Musculoskeletal", I
have a feeling this is a result of the values for that column (General
Developmental, and LAB TEST RESULTS) have spaces in them. Can anyone help me
get around this without having to change all the values in the SQL database?


Well, have you checked what the value of dr("MAIN_CATEGORY") actually
is at runtime? Maybe the string is being truncated, or something like
that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2
ST
hmm that seems to be OK. it looks like it's not recognizing the "OTHER"
cases. It skips right over them...but recognizes it in the Musculoskeletal
group.

"Jon Skeet [C# MVP]" wrote:
ST <ST@discussions.microsoft.com> wrote:
Can anyone tell me why the code below won't work for me? It's not picking up
the results from the "OTHER" sections of "General Developmental" and "LAB
TEST RESULTS". Because the OTHER section worked for "Musculoskeletal", I
have a feeling this is a result of the values for that column (General
Developmental, and LAB TEST RESULTS) have spaces in them. Can anyone help me
get around this without having to change all the values in the SQL database?


Well, have you checked what the value of dr("MAIN_CATEGORY") actually
is at runtime? Maybe the string is being truncated, or something like
that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #3
ST <ST@discussions.microsoft.com> wrote:
hmm that seems to be OK. it looks like it's not recognizing the "OTHER"
cases. It skips right over them...but recognizes it in the Musculoskeletal
group.


When you step through in the debugger, which line is it getting to
before skipping where you don't expect it to?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #4
ST
Ok, I've debugged line by line....this is what it looks like:
-For General developmental, it doesn't seem to even be recognizing the OTHER
case...it skips right over it and goes from CASE Behavioral Problems, right
to the notes.
-For LAB TEST RESULTS, it recognizes the CASE OTHER, BUT, it seems to be
going thru the code below the CASE OTHER in the Musculoskeletal section,
which the first If statement for dr("MAIN CATEGORY") always results in false
because it's the wrong section. When I do a watch window The MAIN CATEGORY
is LAB TEST RESULTS...however it just seems to be running thru this code for
some reason:
Case "OTHER"
If dr("MAIN_CATEGORY") = "Musculoskeletal" Then
If Not dr("CHOICE").ToString = "NA" Then
lblMS_O.Text = dr("CHOICE").ToString.ToUpper
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA"
Then
lblMS_O_F.Text =
dr("IS_FAMILY_HISTORY").ToString.ToUpper
End If
End If

***Instead of this code:
Case "OTHER"
If dr("MAIN_CATEGORY") = "LAB TEST RESULTS" Then
If Not dr("CHOICE").ToString = "NA" Then
lblLTR_O.Text = dr("CHOICE")
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA"
Then
lblLTR_O_F.Text = dr("IS_FAMILY_HISTORY")
End If
What do you think might be going on?? I'm sort of new to vb.net...and I'm
trying to work with code that someone else wrote. There is something else I
don't understand. It seems to also be going thru an EMG section which I
can't find anywhere in the code. When I debug, the main category changes to
EMG, but there are no EMG cases anywhere...but it seems to run thru it. Do
you think there's some hidden code somewhere? Thanks for your help!
"Jon Skeet [C# MVP]" wrote:
ST <ST@discussions.microsoft.com> wrote:
hmm that seems to be OK. it looks like it's not recognizing the "OTHER"
cases. It skips right over them...but recognizes it in the Musculoskeletal
group.


When you step through in the debugger, which line is it getting to
before skipping where you don't expect it to?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #5
ST <ST@discussions.microsoft.com> wrote:
Ok, I've debugged line by line....this is what it looks like:
-For General developmental, it doesn't seem to even be recognizing the OTHER
case...it skips right over it and goes from CASE Behavioral Problems, right
to the notes.
Have you checked the length of the string in the debugger, to see if
it's got any trailing spaces or anything like that?
-For LAB TEST RESULTS, it recognizes the CASE OTHER, BUT, it seems to be
going thru the code below the CASE OTHER in the Musculoskeletal section,
which the first If statement for dr("MAIN CATEGORY") always results in false
because it's the wrong section. When I do a watch window The MAIN CATEGORY
is LAB TEST RESULTS...however it just seems to be running thru this code for
some reason:
Case "OTHER"
If dr("MAIN_CATEGORY") = "Musculoskeletal" Then
If Not dr("CHOICE").ToString = "NA" Then
lblMS_O.Text = dr("CHOICE").ToString.ToUpper
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA"
Then
lblMS_O_F.Text =
dr("IS_FAMILY_HISTORY").ToString.ToUpper
End If
End If

***Instead of this code:
Case "OTHER"
If dr("MAIN_CATEGORY") = "LAB TEST RESULTS" Then
If Not dr("CHOICE").ToString = "NA" Then
lblLTR_O.Text = dr("CHOICE")
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA"
Then
lblLTR_O_F.Text = dr("IS_FAMILY_HISTORY")
End If
What do you think might be going on?? I'm sort of new to vb.net...and I'm
trying to work with code that someone else wrote. There is something else I
don't understand. It seems to also be going thru an EMG section which I
can't find anywhere in the code. When I debug, the main category changes to
EMG, but there are no EMG cases anywhere...but it seems to run thru it. Do
you think there's some hidden code somewhere? Thanks for your help!


I wonder whether the debugger is out of date with the code that you've
got in front of you. I've seen that a few times - cleaning out the
whole project and rebuilding usually fixes it for me.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #6
ST
Well I just checked the length of the string...it says it's 5 for "OTHER" so
that seems to make sense. What do you mean exactly when you say "clean out"
and rebuild? That might work.

"Jon Skeet [C# MVP]" wrote:
ST <ST@discussions.microsoft.com> wrote:
Ok, I've debugged line by line....this is what it looks like:
-For General developmental, it doesn't seem to even be recognizing the OTHER
case...it skips right over it and goes from CASE Behavioral Problems, right
to the notes.


Have you checked the length of the string in the debugger, to see if
it's got any trailing spaces or anything like that?
-For LAB TEST RESULTS, it recognizes the CASE OTHER, BUT, it seems to be
going thru the code below the CASE OTHER in the Musculoskeletal section,
which the first If statement for dr("MAIN CATEGORY") always results in false
because it's the wrong section. When I do a watch window The MAIN CATEGORY
is LAB TEST RESULTS...however it just seems to be running thru this code for
some reason:
Case "OTHER"
If dr("MAIN_CATEGORY") = "Musculoskeletal" Then
If Not dr("CHOICE").ToString = "NA" Then
lblMS_O.Text = dr("CHOICE").ToString.ToUpper
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA"
Then
lblMS_O_F.Text =
dr("IS_FAMILY_HISTORY").ToString.ToUpper
End If
End If

***Instead of this code:
Case "OTHER"
If dr("MAIN_CATEGORY") = "LAB TEST RESULTS" Then
If Not dr("CHOICE").ToString = "NA" Then
lblLTR_O.Text = dr("CHOICE")
End If
If Not dr("IS_FAMILY_HISTORY").ToString = "NA"
Then
lblLTR_O_F.Text = dr("IS_FAMILY_HISTORY")
End If
What do you think might be going on?? I'm sort of new to vb.net...and I'm
trying to work with code that someone else wrote. There is something else I
don't understand. It seems to also be going thru an EMG section which I
can't find anywhere in the code. When I debug, the main category changes to
EMG, but there are no EMG cases anywhere...but it seems to run thru it. Do
you think there's some hidden code somewhere? Thanks for your help!


I wonder whether the debugger is out of date with the code that you've
got in front of you. I've seen that a few times - cleaning out the
whole project and rebuilding usually fixes it for me.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #7
ST <ST@discussions.microsoft.com> wrote:
Well I just checked the length of the string...it says it's 5 for "OTHER" so
that seems to make sense. What do you mean exactly when you say "clean out"
and rebuild? That might work.


I mean you should shut down VS.NET, find the binaries and any
intermediate files (in the bin and obj directories for C# - I don't
know about VB.NET) and delete them. Then restart, rebuild, and see if
that helps.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #8
ST
ok I just tried that. Didn't seem to work. Any other suggestions? I just
can't see what could be wrong with this. Is there anything else I should
look for in particular when I debug?
"Jon Skeet [C# MVP]" wrote:
ST <ST@discussions.microsoft.com> wrote:
Well I just checked the length of the string...it says it's 5 for "OTHER" so
that seems to make sense. What do you mean exactly when you say "clean out"
and rebuild? That might work.


I mean you should shut down VS.NET, find the binaries and any
intermediate files (in the bin and obj directories for C# - I don't
know about VB.NET) and delete them. Then restart, rebuild, and see if
that helps.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #9
ST <ST@discussions.microsoft.com> wrote:
ok I just tried that. Didn't seem to work. Any other suggestions? I just
can't see what could be wrong with this. Is there anything else I should
look for in particular when I debug?


None that I can think of. I suggest you start a new project which
*just* has this bit of code in (and whatever you need to get the sample
data) - that may make it easier to debug. If you find that the same
code is doing different things in one project than in another, you know
there's something very odd going on...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #10

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

Similar topics

16
by: cover | last post by:
I have a form with drop down menus to query for name, month, and year to capture activity accordingly by an individual for a given month and given year. But I'd like to also be able to query ALL...
6
by: Mikko Nummelin | last post by:
As the XSLT namespace is declared to be used in XSL documents like this: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> , isn't this a risky practice as it...
3
by: Kareem Nutt | last post by:
I have the following: varchar name; .... select statement puts value into name ... ..... name.arr = '\0'; printf ("name is %s.\n", name.arr); Example of what I get when I do this I get:...
13
by: Thomas Liesner | last post by:
Hi all, i am having a textfile which contains a single string with names. I want to split this string into its records an put them into a list. In "normal" cases i would do something like: >...
14
by: Sergei Riaguzov | last post by:
I have a very strange behaviour with POST keys. Consider a test: wtf.html: === Cut === <form action="eh.php" method="POST">     <input type="checkbox" name="many spaces and. . dots. . "/>...
3
by: Chris Sharman | last post by:
Are spaces allowed in names ? Eg <input name="my field" type="text" value="my data"> The html4 dtd seems to say this is cdata, which allows embedded single spaces, but say agents may trim...
9
by: Steven C. | last post by:
Hello: I'm getting an error, "primary key not defined" when trying to use the FIND method on the DataTable Rows collection. I have a typed dataset called 'MortgagesDS' that I created with the...
5
by: raj | last post by:
I know what interfaces are and what they used for etc. Today i am learning about serilization. I know to mark the class "serializable" and implement ISerializable interface, and then implement...
8
by: eggie5 | last post by:
I keep getting an error for line 7, what's wrong with this? from django.db import models class Poll(models.Model): question = models.CharField(max_length=200) pub_date =...
2
by: runway27 | last post by:
i am helping a friend to build a forum website which uses php and mysql database. i am working on the registeration page for the forum website and its validation. i am using php 5.2.5 i am able to...
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: 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
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
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...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.