5 Replies - 1272 Views - Last Post: 16 September 2009 - 10:01 PM Rate Topic: -----

#1 na3em  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 11-September 09

choose data from a text box

Posted 15 September 2009 - 02:41 AM

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
Is This A Good Question/Topic? 0
  • +

Replies To: choose data from a text box

#2 ankurwase  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 10
  • Joined: 12-June 09

Re: choose data from a text box

Posted 15 September 2009 - 03:04 AM

View Postna3em, 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



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
Was This Post Helpful? 1
  • +
  • -

#3 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

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]);


Was This Post Helpful? 0
  • +
  • -

#4 na3em  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 11-September 09

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

Was This Post Helpful? 0
  • +
  • -

#5 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: choose data from a text box

Posted 16 September 2009 - 05:19 AM

View Postna3em, 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

Was This Post Helpful? 1
  • +
  • -

#6 ankurwase  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 10
  • Joined: 12-June 09

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...
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1