Click here to Skip to main content
15,896,606 members
Home / Discussions / C#
   

C#

 
GeneralRe: WinForms: visual clipping of docked controls added at run-time to Panel with AutoScroll=true Pin
Luc Pattyn27-Nov-11 22:06
sitebuilderLuc Pattyn27-Nov-11 22:06 
Answerpartial solution found : Re: WinForms: visual clipping of docked controls added at run-time to Panel with AutoScroll=true Pin
BillWoodruff27-Nov-11 4:50
professionalBillWoodruff27-Nov-11 4:50 
QuestionAbout this 3D graph in C# Pin
derek091927-Nov-11 1:27
derek091927-Nov-11 1:27 
AnswerRe: About this 3D graph in C# Pin
RobCroll27-Nov-11 16:31
RobCroll27-Nov-11 16:31 
GeneralRe: About this 3D graph in C# Pin
derek091928-Nov-11 0:03
derek091928-Nov-11 0:03 
GeneralRe: About this 3D graph in C# Pin
Alan Balkany28-Nov-11 6:01
Alan Balkany28-Nov-11 6:01 
GeneralRe: About this 3D graph in C# Pin
derek091928-Nov-11 13:37
derek091928-Nov-11 13:37 
Questionconvert IEnumerable to Datatable Pin
jojoba201127-Nov-11 0:11
jojoba201127-Nov-11 0:11 
How can i convert the IEnumerable<string> to Datatable.
i have this method but it will be slow in large data.
<pre lang="c#">
public static DataTable AsDataTable<T>(this IEnumerable<T> enumerable)
{
    if (enumerable == null)
    {
        throw new ArgumentNullException("enumerable");
    }

    DataTable table = new DataTable();
    if (enumerable.Any())
    {
        IList<PropertyInfo> properties = typeof(T)
                                            .GetProperties()
                                            .Where(p => p.CanRead && (p.GetIndexParameters().Length == 0))
                                            .ToList();

        foreach (PropertyInfo property in properties)
        {
            table.Columns.Add(property.Name, property.PropertyType);
        }

        IList<MethodInfo> getters = properties.Select(p => p.GetGetMethod()).ToList();

        table.BeginLoadData();
        try
        {
            object[] values = new object[properties.Count];
            foreach (T item in enumerable)
            {
                for (int i = 0; i < getters.Count; i++)
                {
                    values[i] = getters[i].Invoke(item, BindingFlags.Default, null, null, CultureInfo.InvariantCulture);
                }

                table.Rows.Add(values);
            }
        }
        finally
        {
            table.EndLoadData();
        }
    }

    return table;
}

QuestionMatch Two List Box By Sorting ... Pin
nassimnastaran26-Nov-11 7:13
nassimnastaran26-Nov-11 7:13 
AnswerRe: Match Two List Box By Sorting ... Pin
Not Active26-Nov-11 8:05
mentorNot Active26-Nov-11 8:05 
AnswerRe: Match Two List Box By Sorting ... Pin
Luc Pattyn26-Nov-11 8:14
sitebuilderLuc Pattyn26-Nov-11 8:14 
GeneralRe: Match Two List Box By Sorting ... Pin
nassimnastaran26-Nov-11 8:42
nassimnastaran26-Nov-11 8:42 
AnswerRe: Match Two List Box By Sorting ... Pin
Luc Pattyn26-Nov-11 9:53
sitebuilderLuc Pattyn26-Nov-11 9:53 
GeneralRe: Match Two List Box By Sorting ... Pin
nassimnastaran26-Nov-11 10:22
nassimnastaran26-Nov-11 10:22 
GeneralRe: Match Two List Box By Sorting ... Pin
Luc Pattyn26-Nov-11 10:34
sitebuilderLuc Pattyn26-Nov-11 10:34 
GeneralRe: Match Two List Box By Sorting ... Pin
nassimnastaran26-Nov-11 10:43
nassimnastaran26-Nov-11 10:43 
AnswerRe: Match Two List Box By Sorting ... Pin
BillWoodruff26-Nov-11 19:55
professionalBillWoodruff26-Nov-11 19:55 
AnswerRe: Match Two List Box By Sorting ... Pin
DaveyM6926-Nov-11 22:48
professionalDaveyM6926-Nov-11 22:48 
GeneralRe: Match Two List Box By Sorting ... Pin
nassimnastaran27-Nov-11 7:59
nassimnastaran27-Nov-11 7:59 
Questionthread resume with out using sleep method Pin
somasekhara77726-Nov-11 6:11
somasekhara77726-Nov-11 6:11 
AnswerRe: thread resume with out using sleep method Pin
Mark Salsbery26-Nov-11 6:28
Mark Salsbery26-Nov-11 6:28 
AnswerRe: thread resume with out using sleep method Pin
Luc Pattyn26-Nov-11 6:30
sitebuilderLuc Pattyn26-Nov-11 6:30 
QuestionscrollBars Pin
FM726-Nov-11 5:25
FM726-Nov-11 5:25 
AnswerRe: scrollBars Pin
Luc Pattyn26-Nov-11 5:33
sitebuilderLuc Pattyn26-Nov-11 5:33 
GeneralRe: scrollBars Pin
FM726-Nov-11 6:07
FM726-Nov-11 6:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.