Click here to Skip to main content
15,879,535 members
Home / Discussions / C#
   

C#

 
GeneralRe: WinAPI interaction Pin
Spacix One30-Apr-08 2:28
Spacix One30-Apr-08 2:28 
QuestionHow to find if a particular file is loaded by processes Pin
Mushtaque Nizamani29-Apr-08 8:54
Mushtaque Nizamani29-Apr-08 8:54 
GeneralRe: How to find if a particular file is loaded by processes Pin
Giorgi Dalakishvili29-Apr-08 9:19
mentorGiorgi Dalakishvili29-Apr-08 9:19 
AnswerRe: How to find if a particular file is loaded by processes Pin
PIEBALDconsult29-Apr-08 13:47
mvePIEBALDconsult29-Apr-08 13:47 
GeneralRe: How to find if a particular file is loaded by processes Pin
Mushtaque Nizamani29-Apr-08 13:56
Mushtaque Nizamani29-Apr-08 13:56 
GeneralLAN TicTacToe Pin
Member 365210629-Apr-08 8:23
Member 365210629-Apr-08 8:23 
GeneralRe: LAN TicTacToe Pin
carbon_golem29-Apr-08 8:43
carbon_golem29-Apr-08 8:43 
GeneralAdvice on Matching data Pin
MumbleB29-Apr-08 8:19
MumbleB29-Apr-08 8:19 
Hi Guys. I need some Advice/Help please.

I have two portions to my application that I am working on at the moment and they both working fine but I want to combine the two or to have the one matching data from the other one.

First, I have this Button event that would take data from a txtbox that would match data and return a MessageBox with a String. See below.

        private void btnValidate_Click(object sender, EventArgs e)
        {
            int pcode = 0;

            if (int.TryParse(txtboxPcode.Text, out pcode) == false)
            {
                MessageBox.Show("Invalid Integer!");
                return;
            }
            if((pcode >= 4731) && (pcode <=6499))

            {
                MessageBox.Show("Eastern Cape");
                return;
            }
            if ((pcode >= 9300) && (pcode <= 9999))
                {
                MessageBox.Show("Free State");
                return;
                }
}


The other section in my app I am using FileHelpers to import a CSV file into a MultiLine txtbox. This works fine. I want to use one of the files in the filehelpers import to match to the above code and return the matched value in the MessageBox. Below the FileHelpers Code. In the below code I want to use the imp.CallComments and match that to the pcode above and return the value currently returned in the Messagebox.

private void btnOpenFile_Click(object sender, EventArgs e)
{
    if (openFileDialog1.ShowDialog() != DialogResult.OK)
    {
        this.Close();
    }
    else
    {
        txtboxSelectFile.Text = openFileDialog1.FileName;
    }
    string filePath;
    filePath = txtboxSelectFile.Text;

    FileHelperEngine<CsvImp> engine = new FileHelperEngine<CsvImp>();

    engine.ErrorManager.ErrorMode = ErrorMode.SaveAndContinue;

    CsvImp[] res = engine.ReadFile(filePath);

    if (engine.ErrorManager.ErrorCount > 0)
        engine.ErrorManager.SaveErrors("Errors.txt");
        foreach (CsvImp imp in res)
        {
            txtboxDisplay.Text += imp.CompanyCode + "\t" + imp.Caller + "\t" +
                imp.Reference + "\t" + imp.Agent + "\t" + imp.CallComments + Environment.NewLine;
        }
    }


Can somebody please advise me what the best way of doing this would be please? Any advice is greatly appreciated.

Thanking you in advance.

Excellence is doing ordinary things extraordinarily well.

GeneralRe: Advice on Matching data Pin
Jimmanuel29-Apr-08 9:38
Jimmanuel29-Apr-08 9:38 
GeneralRadGrid, DataTable And Caption Problem Pin
KlimUser29-Apr-08 7:52
KlimUser29-Apr-08 7:52 
GeneralRe: RadGrid, DataTable And Caption Problem Pin
Bert delaVega29-Apr-08 8:17
Bert delaVega29-Apr-08 8:17 
GeneralRe: RadGrid, DataTable And Caption Problem Pin
KlimUser29-Apr-08 10:47
KlimUser29-Apr-08 10:47 
GeneralSomething basic Pin
Spykraft29-Apr-08 7:13
Spykraft29-Apr-08 7:13 
GeneralRe: Something basic Pin
PIEBALDconsult29-Apr-08 7:24
mvePIEBALDconsult29-Apr-08 7:24 
GeneralRe: Something basic Pin
carbon_golem29-Apr-08 7:28
carbon_golem29-Apr-08 7:28 
GeneralRe: Something basic Pin
PIEBALDconsult29-Apr-08 12:11
mvePIEBALDconsult29-Apr-08 12:11 
GeneralRe: Something basic Pin
Spykraft29-Apr-08 7:38
Spykraft29-Apr-08 7:38 
GeneralRe: Something basic Pin
carbon_golem29-Apr-08 8:06
carbon_golem29-Apr-08 8:06 
GeneralRe: Something basic Pin
Spykraft29-Apr-08 12:11
Spykraft29-Apr-08 12:11 
GeneralRe: Something basic Pin
carbon_golem29-Apr-08 16:59
carbon_golem29-Apr-08 16:59 
GeneralRe: Something basic Pin
PIEBALDconsult29-Apr-08 9:31
mvePIEBALDconsult29-Apr-08 9:31 
GeneralDatagridview and keyenter Pin
Canann29-Apr-08 4:43
Canann29-Apr-08 4:43 
QuestionRe: Datagridview and keyenter Pin
Canann30-Apr-08 2:51
Canann30-Apr-08 2:51 
QuestionHow to generate Typed DataSet with CodeDom ? Pin
hdv21229-Apr-08 3:03
hdv21229-Apr-08 3:03 
Generalanti-pattern in GC Pin
George_George29-Apr-08 2:59
George_George29-Apr-08 2:59 

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.