Skip to content

How to compare if a text box has two strings

Krishna

Asked Mar 16, 2015, 10:57 PM EDT1 answer
Share
LinkedInX
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Comparitive .aspx.cs" Inherits="Comparitive_" %>

<!DOCTYPE html>

   
   
   
              
    Login        
        Home
       
       
       
                         

                                                   User Entity (or)User Query

       
           
               
                   
               
               
                   
                  
                   
 
                   
                    *
                   
                   
                   
            
                   
                    *
                   
                   
         
                   
            
                                               
                   
                   
                   
             
                   
           
       
       

   
   

in text box 2 i am entering the (hyderabad & banglore ) i should compare the text box values with the values present in the database and retrieve the result 
thanks in advance

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Hi Chaitanya,

    Do you want to get data on basis of 2 word which you have entered in textbox2 ??

    if Yes, then simply split values of textbox by space. you will get word array list.
    Can be done var ListofWords = textbox2.Text.trim().Split(' ');

    Than in database use IN clause in query pass word list.
    0