adding data from multiline text box

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

Hello,
I'm new to the asp.net programming world and one of my first projects is
to create an entry form for managers to enter in some information about
their employees. My form has a multiline text box so the manager can add 1
or more employeess. They have to enter in the information as
domain\username. My question is, how can I strip the domain name from the
begining of the username? It has to be stored in a seperate column in the
database, and how can I get each user name in the textbox to add to my
database. I also need to check to make sure the employee exists in my
database, so I first need to verify the employee then if their valid save
them to the database.

what is the best way to do this? how would I do this? I've been doing basic
asp.net development but nothing like this before.
 
If you are using VB you could do something like this:

'this returns the list of users from the text field seperated
'by carriage returns
dim users() as string = txtUserNameField.Text.Split(vbCr)

' this loops through all of the users
for i as integer = to users.length - 1
'this splits up the user name from the domain
'because it is seperated by the "\"
dim networkName() as string = users(i).Split("\")

'to access the user name use networkName(1)
next i
 
Back
Top