Click here to Skip to main content
14,357,784 members
   

C#

 
AnswerRe: About Luhn Algorithm Pin
Pete O'Hanlon3-Oct-19 2:53
protectorPete O'Hanlon3-Oct-19 2:53 
AnswerRe: About Luhn Algorithm Pin
Dave Kreskowiak3-Oct-19 2:57
mveDave Kreskowiak3-Oct-19 2:57 
AnswerRe: About Luhn Algorithm Pin
OriginalGriff3-Oct-19 5:04
protectorOriginalGriff3-Oct-19 5:04 
AnswerRe: About Luhn Algorithm Pin
CPallini3-Oct-19 8:55
mveCPallini3-Oct-19 8:55 
AnswerRe: About Luhn Algorithm Pin
Kevin Marois4-Oct-19 8:27
professionalKevin Marois4-Oct-19 8:27 
QuestionGet constant from column ordinal. Pin
MAW3030-Sep-19 9:47
memberMAW3030-Sep-19 9:47 
AnswerRe: Get constant from column ordinal. Pin
Richard MacCutchan30-Sep-19 10:17
protectorRichard MacCutchan30-Sep-19 10:17 
AnswerRe: Get constant from column ordinal. Pin
BillWoodruff1-Oct-19 0:37
mveBillWoodruff1-Oct-19 0:37 
See if this gives you useful ideas:
public class SwitchOnDTOrdinal
{
    public SwitchOnDTOrdinal(DataTable table)
    {
        TheTable =  table;

        validColumnNames = table.Columns
            .Cast<DataColumn>()
            .Select(col => col.ColumnName)
            .ToList();
    }

    private List<string> validColumnNames;

    private DataTable TheTable;

    public void SwitchA(string cname)
    {
        if (! validColumnNames.Contains(cname))
        {
            throw new ArgumentException(@"{cname} is not a valid column name");
        }

        switch(TheTable.Columns[cname].Ordinal)
        {
            case 0:
                break;
            case 1:
                break;
            case 2:
                break;
            case 3:
                break;
            default:
                throw new ArgumentOutOfRangeException();
        }
    }
}

«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali


modified 1-Oct-19 6:48am.

AnswerRe: Get constant from column ordinal. Pin
Luc Pattyn1-Oct-19 4:55
professionalLuc Pattyn1-Oct-19 4:55 
QuestionUpload encrypted excel file to datagridview Pin
HoaiNTT061029-Sep-19 23:48
memberHoaiNTT061029-Sep-19 23:48 
QuestionRe: Upload encrypted excel file to datagridview Pin
Richard MacCutchan29-Sep-19 23:51
protectorRichard MacCutchan29-Sep-19 23:51 
JokeRe: Upload encrypted excel file to datagridview Pin
lw@zi 30-Sep-19 0:06
professional lw@zi 30-Sep-19 0:06 
AnswerRe: Upload encrypted excel file to datagridview Pin
OriginalGriff30-Sep-19 2:30
protectorOriginalGriff30-Sep-19 2:30 
QuestionCould Not Decrease right of Non Client in Edit Control Pin
Member 1180360726-Sep-19 7:33
memberMember 1180360726-Sep-19 7:33 
AnswerRe: Could Not Decrease right of Non Client in Edit Control Pin
Richard MacCutchan26-Sep-19 7:42
protectorRichard MacCutchan26-Sep-19 7:42 
AnswerRe: Could Not Decrease right of Non Client in Edit Control Pin
Dave Kreskowiak26-Sep-19 11:23
mveDave Kreskowiak26-Sep-19 11:23 
GeneralRe: Could Not Decrease right of Non Client in Edit Control Pin
Member 1180360726-Sep-19 22:54
memberMember 1180360726-Sep-19 22:54 
AnswerRe: Could Not Decrease right of Non Client in Edit Control Pin
OriginalGriff27-Sep-19 0:38
protectorOriginalGriff27-Sep-19 0:38 
Question[VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661326-Sep-19 6:03
professionalsteve_949661326-Sep-19 6:03 
AnswerRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
#realJSOP26-Sep-19 6:46
mve#realJSOP26-Sep-19 6:46 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661326-Sep-19 21:47
professionalsteve_949661326-Sep-19 21:47 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
#realJSOP26-Sep-19 23:53
mve#realJSOP26-Sep-19 23:53 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
lw@zi 27-Sep-19 2:09
professional lw@zi 27-Sep-19 2:09 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
#realJSOP27-Sep-19 6:45
mve#realJSOP27-Sep-19 6:45 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661329-Sep-19 21:48
professionalsteve_949661329-Sep-19 21:48 

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.