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.'

System.Data.EvaluateException: 'Cannot perform 'Like' operation on System.Double and System.String.'

- private void txtSearchBar_TextChanged(object sender, EventArgs e)
- {
- if (comboxSearch.Text == "Mobile No")
- {
- DataView dv = dt.DefaultView;
- dv.RowFilter = "MobileNo LIKE '%" + txtSrchBar.Text.ToString() + "%' ";
- }
- }
Amit GuptaPosted Nov 20, 2018, 11:45 PM
Rizwan AhmedPosted Nov 21, 2018, 6:30 AM
Amit GuptaPosted Nov 21, 2018, 5:36 AM
Rizwan AhmedPosted Nov 21, 2018, 5:32 AM
Rizwan AhmedPosted Nov 21, 2018, 5:30 AM
Laxmidhar SahooPosted Nov 21, 2018, 1:53 AM
Rizwan AhmedPosted Nov 21, 2018, 1:48 AM
Laxmidhar Sahoo it's in Double.
Amit Gupta i tried it but now this error comes, System.Data.EvaluateException: 'Cannot find column [System.String].' and indicate to this code dv.RowFilter = "Convert(System.String, MobileNo) LIKE '%" + txtSrchBar.Text.ToString() + "%' ";
Sanwar RanwaPosted Nov 20, 2018, 11:03 PM
Laxmidhar SahooPosted Nov 20, 2018, 9:38 PM