Click here to Skip to main content
15,906,708 members
Home / Discussions / C#
   

C#

 
GeneralRe: I need to run a Exe in the Setup Install process. Pin
Pete O'Hanlon10-Jul-12 0:17
mvePete O'Hanlon10-Jul-12 0:17 
GeneralRe: I need to run a Exe in the Setup Install process. Pin
glennPattonWork310-Jul-12 0:35
professionalglennPattonWork310-Jul-12 0:35 
GeneralRe: I need to run a Exe in the Setup Install process. Pin
Pete O'Hanlon10-Jul-12 0:55
mvePete O'Hanlon10-Jul-12 0:55 
GeneralRe: I need to run a Exe in the Setup Install process. Pin
glennPattonWork310-Jul-12 0:58
professionalglennPattonWork310-Jul-12 0:58 
Questionmake a class for use textbox act as masketextbox Pin
Member 424148410-Jul-12 0:05
Member 424148410-Jul-12 0:05 
AnswerRe: make a class for use textbox act as masketextbox Pin
Abhinav S10-Jul-12 0:09
Abhinav S10-Jul-12 0:09 
AnswerRe: make a class for use textbox act as masketextbox Pin
Pete O'Hanlon10-Jul-12 0:16
mvePete O'Hanlon10-Jul-12 0:16 
AnswerRe: make a class for use textbox act as masketextbox Pin
Luc Pattyn10-Jul-12 0:45
sitebuilderLuc Pattyn10-Jul-12 0:45 
Questionadvanced excel Pin
Member 91698879-Jul-12 22:17
Member 91698879-Jul-12 22:17 
AnswerRe: advanced excel Pin
Eddy Vluggen10-Jul-12 4:08
professionalEddy Vluggen10-Jul-12 4:08 
QuestionWPF DATAGRID IMAGE COLUMN IMAGE CHANGING Pin
ALI HASSAN RIZVI9-Jul-12 21:25
ALI HASSAN RIZVI9-Jul-12 21:25 
AnswerRe: WPF DATAGRID IMAGE COLUMN IMAGE CHANGING Pin
OriginalGriff9-Jul-12 21:38
mveOriginalGriff9-Jul-12 21:38 
AnswerRe: WPF DATAGRID IMAGE COLUMN IMAGE CHANGING Pin
Pete O'Hanlon9-Jul-12 22:11
mvePete O'Hanlon9-Jul-12 22:11 
QuestionLink between dataset and datagrid Pin
khaledTawa9-Jul-12 20:07
khaledTawa9-Jul-12 20:07 
AnswerRe: Link between dataset and datagrid Pin
OriginalGriff9-Jul-12 21:04
mveOriginalGriff9-Jul-12 21:04 
AnswerRe: Link between dataset and datagrid Pin
Pete O'Hanlon9-Jul-12 22:12
mvePete O'Hanlon9-Jul-12 22:12 
QuestionAccessing HashTable at ButtonClick Level Pin
mrfalk9-Jul-12 13:28
mrfalk9-Jul-12 13:28 
SuggestionRe: Accessing HashTable at ButtonClick Level Pin
Trak4Net9-Jul-12 17:19
Trak4Net9-Jul-12 17:19 
GeneralRe: Accessing HashTable at ButtonClick Level Pin
mrfalk10-Jul-12 6:02
mrfalk10-Jul-12 6:02 
GeneralRe: Accessing HashTable at ButtonClick Level Pin
Trak4Net10-Jul-12 6:54
Trak4Net10-Jul-12 6:54 
AnswerRe: Accessing HashTable at ButtonClick Level Pin
Pete O'Hanlon10-Jul-12 7:09
mvePete O'Hanlon10-Jul-12 7:09 
GeneralRe: Accessing HashTable at ButtonClick Level Pin
mrfalk10-Jul-12 11:14
mrfalk10-Jul-12 11:14 
There is not really a "requirement" for me to use a Hashtable; it's just what I know how to use. I need to read the csv file and then have the user enter their ein number and then I pass back basic demographic information for user confirmation.

What are the advantages of using a generic Dictionary instead of a Hashtable?

I'm sure what I am doing is not best practices and I'm sure I'll cringe looking back at this program at some point in the future Smile | :)

Below is my work-in-progress code...

Thanks for taking the time to review my question and providing any feedback!



C#
public partial class Form1 : Form
    {

        //hashtable for empData
        Hashtable empData = new Hashtable();

        public Form1()
        {
            InitializeComponent();

            //variables for pulling data from data array

            string fName = "";
            string mName = "";
            string lName = "";
            string userProfile = "";
            string userEIN = "";

            using (CsvReader csv = new CsvReader(new StreamReader(@"C:\temp\test.csv"), true))
            {

                int fieldCount = csv.FieldCount;
                string[] headers = csv.GetFieldHeaders();
                //put data into an array....
                string[] data = new string[csv.FieldCount];


                while (csv.ReadNextRecord())
                {

                    //data put into array
                    csv.CopyCurrentRecordTo(data);


                    //rtv data from array

                    fName = data[1];
                    mName = data[2];
                    lName = data[3];
                    userProfile = data[5];
                    userEIN = data[11];


                    string concatData = (fName + "," + mName + "," + lName + "," + userProfile.ToLower());


                    //put data into hash table

                    empData.Add(userEIN, concatData);

                }//end while

            }


        }// end Form1



        private void button1_Click(object sender, EventArgs e)
        {
            //user entered ok - 

            string saveEIN = userEIN.Text;

            //retrieve demographic values from has table by ein number provided
           //Display demo data from hashtable to have user confirm identity

            string hashData = empData[saveEIN].ToString();




            //store profile used to login for copy process later
            //not working
            string userName = WindowsIdentity.GetAnonymous().Name;

          
        }


    }

SuggestionRe: Accessing HashTable at ButtonClick Level Pin
Matt T Heffron10-Jul-12 14:22
professionalMatt T Heffron10-Jul-12 14:22 
GeneralRe: Accessing HashTable at ButtonClick Level Pin
mrfalk11-Jul-12 10:46
mrfalk11-Jul-12 10:46 
QuestionQuestion... loading unmanaged dll in x64 system Pin
Blubbo9-Jul-12 9:25
Blubbo9-Jul-12 9:25 

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.