Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

Question About a Webservice

Apr 16 2003 10:15 AM
Hello, I have created a webservice to search for Phone Numbers and Address . In this webservice, I am trying to build a query to send to my sql server depending on what is enterend in the form. Here is the Code that I am having a problem with. When I Enter a Name and a City.. It works right, but when I leave the City blank it dosn't seem to go to the next else if block. The Complete Code to this webservice can be found here: http://www.ubtanet.com/example/example.php If Someone could Help me out and tell me what I am doing wrong. I would be very Greatful. Thanks Vinko if(LName != "" && City != "") { this.sqlSelectCommand1.CommandText = "SELECT dm_ch_cos, dm_s_name_1, dm_s_name_2, dm_s_street, dm_s_community, dm_s_phone FROM directory_master WHERE (dm_s_name_1 LIKE @LName + \'%\') AND (dm_s_community = @City) ORDER BY dm_s_community"; } else if(LName != "" && City == ""; { this.sqlSelectCommand1.CommandText = "SELECT dm_ch_cos, dm_s_name_1, dm_s_name_2, dm_s_street, dm_s_community, dm_s_phone FROM directory_master WHERE (dm_s_name_1 LIKE @LName + \'%\') ORDER BY dm_s_name_1"; }

Answers (1)