Rizwan Ahmed

Rizwan Ahmed

  • NA
  • 80
  • 13.2k

Error In Search Of Mobile No From Data Gird

Nov 20 2018 12:17 PM
I want to search mobile no from Grid with selection of ComboBox. Search bar search names but when i code for mobile and cnic this error appeared, error and code as under; (using C# with Access2016 database)

System.Data.EvaluateException: 'Cannot perform 'Like' operation on System.Double and System.String.'
  1. private void txtSearchBar_TextChanged(object sender, EventArgs e)
  2.         {  

  3.             if (comboxSearch.Text == "Mobile No")    
  4.             {  

  5.                 DataView dv = dt.DefaultView;  
  6.   
  7.                 dv.RowFilter = "MobileNo LIKE '%" + txtSrchBar.Text.ToString() + "%' ";  
  8.   
  9.             }   
  10.         }  
 

Answers (9)