aditya immadi

aditya immadi

  • NA
  • 205
  • 71.6k

in sql statement somethin worng

Aug 5 2013 12:14 PM
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

Answers (10)