but i want to add other AND statement on the query below, how it can be done
original query
carian ="select * from MaklumatPelajar where Nama like '%" +
txtcarian.Text + "%' AND Kelas='" + drpkelas.SelectedValue.ToString()
+"'"
new query
carian ="select * from MaklumatPelajar where Nama like '%" +
txtcarian.Text + "%' AND Kelas='" + drpkelas.SelectedValue.ToString()
+ "'" +
"AND Kelas <>'" + lblkelas.Text
when i run this query above there no data display...need help from expertise here
yes..but only on the first part only..second part as i mention before this did you know how to resolve it..?
please see the query below
carian ="select * from MaklumatPelajar where Nama like '%" +
txtcarian.Text + "%' AND Kelas='" + drpkelas.SelectedValue.ToString()
+ "'" +"AND
Kelas <>'" + lblkelas.Text
when i run this query there are no data display..it should display all data that the user selected from dropdown list and will not display data from lblkelas.text....need help for these
carian ="select * from MaklumatPelajar where Nama like '%" + txtcarian.Text
+ "%' AND Kelas='" + drpkelas.SelectedValue.ToString() +
"'" +"AND
Kelas <>'" + lblkelas.Text
Hello again
Perhaps you've missed the last single quote, please try this:
carian ="select * from MaklumatPelajar where Nama like '%" + txtcarian.Text + "%' AND Kelas='" +
drpkelas.SelectedValue.ToString() + "'" +" AND Kelas<>'" + lblkelas.Text+"'"
Marked as answer by afastars on Nov 16, 2012 09:48 AM
afastars
Member
52 Points
221 Posts
Don't Want To Display Selected Data When Apply Filter
Nov 15, 2012 09:24 AM|LINK
i do not want to display selected data when i apply filter, i try to use this query below but still no luck so far
carian = "select * from MaklumatPelajar where Nama like '%" + txtcarian.Text + "%' OR NOT Kelas='" + lblkelas.Text + "'"
i also want to add this query below with OR NOT Condition, but did't know how to do that
the OR NOT condition will compare the value with lblkelas.text
carian ="select * from MaklumatPelajar where Nama like '%" + txtcarian.Text + "%' AND Kelas='" + drpkelas.SelectedValue.ToString() + "'"
i need help from expertise here...
anil.india
Contributor
2613 Points
453 Posts
Re: Don't Want To Display Selected Data When Apply Filter
Nov 15, 2012 02:07 PM|LINK
Try with <> operator
codepattern.net/blog ||@AnilAwadh
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Don't Want To Display Selected Data When Apply Filter
Nov 16, 2012 12:55 AM|LINK
Hello,
"Not" is used to mean to naviagate a condition. So you have to use "<>" when you wanna something that isn't equal to another one.
afastars
Member
52 Points
221 Posts
Re: Don't Want To Display Selected Data When Apply Filter
Nov 16, 2012 03:41 AM|LINK
hi anil.india and Decker
both of you resolve my problem...thanks a lot's
but i want to add other AND statement on the query below, how it can be done
original query
carian ="select * from MaklumatPelajar where Nama like '%" + txtcarian.Text + "%' AND Kelas='" + drpkelas.SelectedValue.ToString() +"'"
new query
carian ="select * from MaklumatPelajar where Nama like '%" + txtcarian.Text + "%' AND Kelas='" + drpkelas.SelectedValue.ToString() + "'" + "AND Kelas <>'" + lblkelas.Text
when i run this query above there no data display...need help from expertise here
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Don't Want To Display Selected Data When Apply Filter
Nov 16, 2012 07:43 AM|LINK
Hi
Is your problem solved? Welcome your feedback;)
afastars
Member
52 Points
221 Posts
Re: Don't Want To Display Selected Data When Apply Filter
Nov 16, 2012 09:04 AM|LINK
yes..but only on the first part only..second part as i mention before this did you know how to resolve it..?
please see the query below
carian ="select * from MaklumatPelajar where Nama like '%" + txtcarian.Text + "%' AND Kelas='" + drpkelas.SelectedValue.ToString() + "'" +"AND Kelas <>'" + lblkelas.Text
when i run this query there are no data display..it should display all data that the user selected from dropdown list and will not display data from lblkelas.text....need help for these
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Don't Want To Display Selected Data When Apply Filter
Nov 16, 2012 09:39 AM|LINK
Hello again
Perhaps you've missed the last single quote, please try this:
carian ="select * from MaklumatPelajar where Nama like '%" + txtcarian.Text + "%' AND Kelas='" + drpkelas.SelectedValue.ToString() + "'" +" AND Kelas<>'" + lblkelas.Text+"'"
afastars
Member
52 Points
221 Posts
Re: Don't Want To Display Selected Data When Apply Filter
Nov 16, 2012 09:48 AM|LINK
hi decker
thanks for reply...you resolve my problem...tq so much really happy with that
and happy to work with expertise also
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Don't Want To Display Selected Data When Apply Filter
Nov 16, 2012 10:25 AM|LINK
Welcome to here again!