hai firends... i have a small problem...my case is when i'm pulling the particular records from database i write the code like this...my problem is the records are not displaying as my wish
they are binding in alphabetical order in my datalist..i want the records as per the. below identitiesthat means id the recor id is 166 then that record must be in first ..can any one help ....
con.Open();
string str = "select * from Candidate where id in(166,175,85,91,155,14,276,5,54,43,314,149,137)";
SqlCommand cmd = new SqlCommand(str, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
Thanks and Regards
Loading
aditya immadiPosted Aug 6, 2013, 11:06 AM
Riyaz AkhtarPosted Aug 6, 2013, 8:29 AM
aditya immadiPosted Aug 6, 2013, 8:05 AM
aditya immadiPosted Aug 6, 2013, 5:44 AM
Riyaz AkhtarPosted Aug 6, 2013, 5:39 AM
try something like below SQL query:
Iftikar HussainPosted Aug 6, 2013, 5:32 AM
Regards,
Iftikar
aditya immadiPosted Aug 6, 2013, 5:23 AM
i need records which has identity 166,175,85,91,155 in first row
and i need records which are has the idenity 14,276,5,54,43 in second row.....etc etc
thanks and regards
Iftikar HussainPosted Aug 6, 2013, 5:09 AM
What is the order you need follow? after 166 which record need to be display? Please provide more details
Regards,
Iftikar
aditya immadiPosted Aug 6, 2013, 5:04 AM
Sanjeeb LenkaPosted Aug 5, 2013, 1:22 PM
try the below query.
string str = "select * from Candidate where id in(166,175,85,91,155,14,276,5,54,43,314,149,137)order by id desc";
Mark it as answered it it helps you.