Hi Sir,
I am in a project in which I need to implement search criteria using OR condition.
means, I need to search different column values based upon one sql parameter.
Kindly tell me the below query to replace 'AND' condition with 'OR'
isnull(cast(tblCustomer.strMobile as nvarchar (20)),'') LIKE '%'+@asMobile+'%'
and
isnull(cast(tblCustomer.strPhoneOff as nvarchar (20)),'') LIKE '%'+@asMobile+'%' and
isnull(cast(tblCustomer.strPhoneOff1 as nvarchar (20)),'') LIKE '%'+@asMobile+'%' and
isnull(cast(tblCustomer.strPhoneRes as nvarchar (20)),'') LIKE '%'+@asMobile+'%'
for c# code , I given like this:-
cmd.Parameters.Add("@asstrMobile", SqlDbType.NVarChar).Value = tbxOfficeResMobile.Text.Trim();
cmd.Parameters.Add("@asPhoneOff", SqlDbType.NVarChar).Value = tbxOfficeResMobile.Text.Trim();
cmd.Parameters.Add("@asPhoneOff1", SqlDbType.NVarChar).Value = tbxOfficeResMobile.Text.Trim();
cmd.Parameters.Add("@asPhoneRes", SqlDbType.NVarChar).Value = tbxOfficeResMobile.Text.Trim();
This code is not working because of all parameter taking same value. I think I need to change the SQL

Bineesh ViswanathPosted Sep 25, 2017, 8:08 AM
Amit GuptaPosted Sep 19, 2017, 4:09 AM
Bineesh ViswanathPosted Sep 19, 2017, 3:58 AM
Amit GuptaPosted Sep 16, 2017, 6:49 AM
Bineesh ViswanathPosted Sep 16, 2017, 6:45 AM
Amit GuptaPosted Sep 16, 2017, 5:54 AM
Prakashraj PPosted Sep 16, 2017, 5:40 AM