Click here to Skip to main content
15,891,844 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there,

I have a check box which bring back a long list of three letter codes for channels (CH5, CH4, ITV.....)

At the moment the list is not sorted and its really annoying trying to find specific channels i want from the list if i only want to select a few. Is there a way to code it so it sorts out the data coming in from the database?

Will this need to be sorted in the SQL statement or the C# on the form?

C#
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
using System.Data;
using FastReport;
using FastReport.Data;
using FastReport.Dialog;
using FastReport.Barcode;
using FastReport.Table;
using FastReport.Utils;

namespace FastReport
{
  public class ReportScript
  {

    private void DateTimePicker1_Click(object sender, EventArgs e)
    {

    }
  }
}



Thanks in advance
Posted
Comments
[no name] 3-Apr-13 8:11am    
Use ORDER BY in your SQL
ZurdoDev 3-Apr-13 8:13am    
You should post as a solution.
ZurdoDev 3-Apr-13 8:13am    
Yes, do it in SQL.

Do it in your SQL when you query your data with an ORDER BY clause.

http://w3schools.com/sql/sql_orderby.asp[^]
 
Share this answer
 
Comments
Geofferz 3-Apr-13 8:24am    
Thanks for your help :)
[no name] 3-Apr-13 8:28am    
You're welcome.
Maciej Los 3-Apr-13 8:25am    
+5!
[no name] 3-Apr-13 8:27am    
Thanks
USE [userdatabase]
GO
SELECT [idx],[col01],[col02],[col03] 
   FROM [userdatabase].[example].[usertable] 
      ORDER BY [idx] 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900