adding data from multiline text box

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.
 
J

Jeremy Ames

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top