Sort a DataTable

I first noticed this technique here: https://www.codeproject.com/Questions/219205/How-To-Sort-Datatable-in-csharp-net

More Juicy goodness here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/87a64069-e78c-4930-a751-d2be7f1e7b50/how-to-sort-datatable?forum=csharpgeneral

 

private void FillSessionChecklistboxForAttendees(CheckedListBox clb, string session_id)
{
MesQueries.TrainingAdmin ta = new MesQueries.TrainingAdmin(_mq);
ta._queryMode = MesQueries.TrainingAdmin.QueryModes.AttendeesForSession;
ta.session_id = session_id;
DataTable dtAttendees = _mq.GetContentDataTable(ta);

Creativity is simply at the bay when you go for the Kamagra order, your excitement starts building and it goes on till you see that satisfactory smile on your partner’s face. you can try these out generic viagra online tadalafil 20mg from india Four wheelers have ceased to become a luxury, and are being used by many people across the globe. If your dog has become arthritic, use ramps or stairs to allow him to get onto sildenafil delivery furniture more easily. It is often an excellent thought viagra online france to check with with your medical doctor prior to taking ginkgo biloba. dtAttendees.DefaultView.Sort = “employee_full_name”;

DataTable dtSortedAttendees = dtAttendees.DefaultView.ToTable();

clb.Items.Clear();
for (int i = 0; i < dtSortedAttendees.Rows.Count; i++)
{
string processName = dtSortedAttendees.Rows[i].Field<string>(“employee_full_name”);
bool isChecked = dtSortedAttendees.Rows[i].Field<bool>(“isChecked”);
clb.Items.Add(processName, isChecked);
}

}

This entry was posted in C#, Programming, SQL Server. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.