hi all iam facing a problem iam reading from a file to a text box and the information that read are displyed like this " 21/1/2009|1221|1"
1221 is the id of a student i need a button to read only 1221 with out the date and the semester code so i can see info about the student
choose data from a text box
Page 1 of 15 Replies - 1097 Views - Last Post: 16 September 2009 - 10:01 PM
Replies To: choose data from a text box
#2
Re: choose data from a text box
Posted 15 September 2009 - 03:04 AM
na3em, on 15 Sep, 2009 - 01:41 AM, said:
hi all iam facing a problem iam reading from a file to a text box and the information that read are displyed like this " 21/1/2009|1221|1"
1221 is the id of a student i need a button to read only 1221 with out the date and the semester code so i can see info about the student
1221 is the id of a student i need a button to read only 1221 with out the date and the semester code so i can see info about the student
Hi na3em,
If you are getting the value like " 21/1/2009|1221|1" eveytime...
u can use array to get the value of userid
dim str as string=" 21/1/2009|1221|1"
dim arr() as string
arr=str.split("|")
Dim studentid as integer
studentid= arr[1]
Thus u can get ur requirement just by passing the required index ......
If this post helps please click this post is helpful for u...
Cheers.
Ankur Wase
#3
Re: choose data from a text box
Posted 15 September 2009 - 05:03 AM
and just incase you are using C#, here is the conversion of ankurwase's code...
string str = "21/1/2009|1221|1";
string[] arr = str.Split(new char[]{ '|' });
int studentID = int.Parse(arr[1]);
#4
Re: choose data from a text box
Posted 15 September 2009 - 11:46 PM
look the" 21/1/2009|1221|1 "is not constant it changes by every student every student has an differnet expiry date and diffrent id what i need is the id which is for ex is 1221 to press a button that read all info about the student ......
This post has been edited by na3em: 15 September 2009 - 11:51 PM
#5
Re: choose data from a text box
Posted 16 September 2009 - 05:19 AM
na3em, on 16 Sep, 2009 - 02:46 AM, said:
look the" 21/1/2009|1221|1 "is not constant it changes by every student every student has an differnet expiry date and diffrent id what i need is the id which is for ex is 1221 to press a button that read all info about the student ......
as long as the data is in the same format, date|id|semester code with the line being a separator, it doesn't matter what the data actually is. Our code will give you the student ID(no matter what it is) as long as the format stays the same.
If the format is not going to be the same, then it's going to be a lot tougher. For example, if your data could possibly be "1|1221|21/1/2009" or "1221|1|21/1/2009", then you are going to have a lot more work ahead of you.
This post has been edited by eclipsed4utoo: 16 September 2009 - 05:30 AM
#6
Re: choose data from a text box
Posted 16 September 2009 - 10:01 PM
look Na3em u r just seperating the different entities by '|' so dont worry abt the data change as said by ECLIPSED..
Go on with the code u will get the things what u want...
Go on with the code u will get the things what u want...
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|