no im not getting multiple id's theres actually two id columns with different values. my code already gets the admission number for me so i just need to get the ID number so the rest of my program can extract me some data using the number.
ive got as far as...
-
toArray[a] = toArray[a].Replace(" ", " ");
-
string[] newArray = toArray[a].Split(new char[]{' '});
-
string str = "[AdmissionNumber] = " + newArray[2];
-
DataRow[] drow = tblPupils.Select(str);
-
pupilstr = drow["PersonID"].ToString(); //cannot convert string to int..
-
//pupilid = Convert.ToInt16(pupilstr);
just a small bit of info. the toArray is an array of people with values like Surname Forname admissionnumber group thats the reason for the splitting up etc. newArray[2] is the addmission number and tblPupils is a already existing data table. the error im getting on this at the moment is
Cannot implicitly convert type 'string' to 'int'
but.. all of my variables are strings or datarows except for pupilid which i havent got to yet.
also its in a for loop wich increments depending on how many values were selected previously( variable a).
Thanks,
Piercy