I have 5 bound columns to be retrieved from the database but I want that on page load event the retrieval of data should be sorted according to that column only,
What I need to do..plz help me!!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’d recommend having the data sorted for you by the database. I presume you have a database query somewhere – either in the ASP.NET page, in a stored procedure, or in your object model – what you need to do is specify an
ORDER BYclause.For example, if you have the following SQL statement used to populate your DataGrid:
And you want the results sorted by, say,
Col3, use the following query instead:Happy Programming!