943,742 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 25526
  • C# RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Feb 12th, 2008
0

Re: Textbox and button visible true or false problem

Sorry i am getting error near
if (id == "world tour")
Error 1 Operator '==' cannot be applied to operands of type 'int' and 'string'
Reputation Points: 10
Solved Threads: 0
Light Poster
raghu.8 is offline Offline
40 posts
since Nov 2007
Feb 12th, 2008
0

Re: Textbox and button visible true or false problem

That's right the variable id is an integer, "world tour" is a string literal you cannot apply the == operator to these different types.

I can see you are either very very green or a forum troll. If the former you need to get a book on basic programming. One that starts from the beginning explaining types and stuff. If the latter I'm done here.
Reputation Points: 262
Solved Threads: 68
Veteran Poster
hollystyles is offline Offline
1,181 posts
since Feb 2005
Feb 12th, 2008
0

Re: Textbox and button visible true or false problem

actually i was totally confused
some times mistake happens
Last edited by raghu.8; Feb 12th, 2008 at 6:56 am.
Reputation Points: 10
Solved Threads: 0
Light Poster
raghu.8 is offline Offline
40 posts
since Nov 2007
Feb 12th, 2008
0

Re: Textbox and button visible true or false problem

still i am getting the same error,when i given hotel booking ID
Reputation Points: 10
Solved Threads: 0
Light Poster
raghu.8 is offline Offline
40 posts
since Nov 2007
Feb 12th, 2008
0

Re: Textbox and button visible true or false problem

You're very close. You have the ID, you need a function in itenary.aspx.cs you can pass the ID too, the function should look the ID up and see if it's the hotel booking catagory and return true or false

C# Syntax (Toggle Plain Text)
  1. public class itinery
  2. {
  3. //all your existing code blah...
  4. private bool IsHotelBooking( int catId)
  5. {
  6. //connect to db pass catId as parameter
  7. //somrthing like string catName = command.ExecuteScalar();
  8. if(catName == "hotel booking")
  9. return true;
  10. else
  11. return false;
  12. }
Reputation Points: 262
Solved Threads: 68
Veteran Poster
hollystyles is offline Offline
1,181 posts
since Feb 2005
Feb 12th, 2008
0

Re: Textbox and button visible true or false problem

Quote ...
still i am getting the same error,when i given hotel booking ID

Don't put the hotel booking id in quotes (I'm guessing that's what you've done). And hard coding an ID into your program logic is very poor, but I guess there's time for that later when you've learned more.
Reputation Points: 262
Solved Threads: 68
Veteran Poster
hollystyles is offline Offline
1,181 posts
since Feb 2005
Feb 12th, 2008
0

Re: Textbox and button visible true or false problem

Is there any posible that i can attach my sample project to this reply box so that you can understand
raghu
Reputation Points: 10
Solved Threads: 0
Light Poster
raghu.8 is offline Offline
40 posts
since Nov 2007
Feb 12th, 2008
0

Re: Textbox and button visible true or false problem

I do understand. But yes you can attach it. Click the Go Advanced button below the reply box. You'll get a bigger editor. SCroll the page down a bit and there's a manage attachments button.
Reputation Points: 262
Solved Threads: 68
Veteran Poster
hollystyles is offline Offline
1,181 posts
since Feb 2005
Feb 12th, 2008
0

Re: Textbox and button visible true or false problem

i
Last edited by raghu.8; Feb 12th, 2008 at 8:27 am.
Reputation Points: 10
Solved Threads: 0
Light Poster
raghu.8 is offline Offline
40 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Shell() command line
Next Thread in C# Forum Timeline: ComboBox Item selection





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC