Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 16, 2012 02:50 PM by Honnappa
Member
112 Points
101 Posts
Apr 16, 2012 02:40 PM|LINK
Thanks for your replies in advance, code goes like this:
string inc = ""; if ((inc != null) || (inc != "")) { int incre = Convert.ToInt32(inc); } else { int incre = 0; } if (xyz == abc) { incre += cb_1; }
544 Points
204 Posts
Apr 16, 2012 02:46 PM|LINK
Declare the incre outside of the if statment
string inc = ""; int incre; if ((inc != null) || (inc != "")) { incre = Convert.ToInt32(inc); } else { incre = 0; } if (xyz == abc) { incre += cb_1; }
Let me know if you need more details.
Participant
1112 Points
534 Posts
Apr 16, 2012 02:50 PM|LINK
Please check your query once...
marian_68
Member
112 Points
101 Posts
I am getting an error "The name 'incre' does not exist in the current context" on the "incre += c...
Apr 16, 2012 02:40 PM|LINK
Thanks for your replies in advance, code goes like this:
string inc = ""; if ((inc != null) || (inc != "")) { int incre = Convert.ToInt32(inc); } else { int incre = 0; } if (xyz == abc) { incre += cb_1; }Dhinadotnet
Member
544 Points
204 Posts
Re: I am getting an error "The name 'incre' does not exist in the current context" on the "incre ...
Apr 16, 2012 02:46 PM|LINK
Declare the incre outside of the if statment
string inc = ""; int incre; if ((inc != null) || (inc != "")) { incre = Convert.ToInt32(inc); } else { incre = 0; } if (xyz == abc) { incre += cb_1; }Let me know if you need more details.
Honnappa
Participant
1112 Points
534 Posts
Re: I am getting an error "The name 'incre' does not exist in the current context" on the "incre ...
Apr 16, 2012 02:50 PM|LINK
Please check your query once...
My Profile