473,796 Members | 2,429 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

adding data from multiline text box

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.


Jul 10 '07 #1
2 4114
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 = txtUserNameFiel d.Text.Split(vb Cr)

' 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

"Steve" <St***@communit y.nospam.comwro te in message
news:e5******** ******@TK2MSFTN GP05.phx.gbl...
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.

Jul 10 '07 #2
I'm using C3, but i can covert this over and try it out, thanks
"Jeremy Ames" <an*******@wher eever.comwrote in message
news:12******** *************** ***********@mic rosoft.com...
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 = txtUserNameFiel d.Text.Split(vb Cr)

' 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

"Steve" <St***@communit y.nospam.comwro te in message
news:e5******** ******@TK2MSFTN GP05.phx.gbl...
>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\usernam e. 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.


Jul 10 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
31063
by: Michael C | last post by:
Hi all, I'm trying to add lines to a multiline textbox. Here's what I'd like to end up with in the textbox (as an example): Line1 Line2 Line3 I've tried a couple of methods but nothing seems to be working. Code like
2
4611
by: Chris | last post by:
Hi We are using style sheets to set the font of our labels and text boxes. This has been working great until we required a text box with a textmode of Multiline. The control picks up the correct font/size until the text mode is changed from single line to multiline. We're currently using the H1, H2, H3 and Body tags for the page.
2
4945
by: Paul Evans | last post by:
Hi, Can anyone help me? I have two text boxes, one single-line and one multiline. I wish to save the text within the multiline textbox as a txt file, with a file name by the text in the single-line textbox. Does that make sense? If the single-line textbox is 'helpme', I wish to create a txt file of the
2
1157
by: Ryan Ternier | last post by:
I'm playing around with DataGrids and the Edit columns ability. I have a text area that can be anywhere from 1-8000 characters. When I add the edit capabilities to this DataGrid it displays a single line TextBox. Is there anyway of getting this textbox to be multi line, and only 450 characters wide?
5
1551
by: Neo Geshel | last post by:
Greetings. I am in a very big pickle. I am trying to add page content - as well as a submit button - programatically to a web form that is supposed to submit to DB and then refresh. That is, a user goes to the web page, which draws the current content out of the db and inserts into a "preview" area as well as the form itself. User makes changes, hits submit button. The page *should* refresh, with the changes saved to the db, and...
9
2781
by: Neo Geshel | last post by:
I have strip-mined, strip-searched, and completely exhausted the Internet (up to the 30th page on Google, with 100 results per page!!), all without finding an answer to my question AS TO WHY IT IS IMPOSSIBLE TO PROGRAMMATICALLY ADD A BUTTON TO A DYNAMICALLY CREATED PAGE. Or, to be more precise, why it is impossible to have an onClick sub respond to that button’s Click event. My main page has only one line:
8
2199
by: Radx | last post by:
Here in my web application, I have a data entry page with serval controls. Some of the controls have autopostback is set true. But the problem is when two or more people are entering data at the same time, in the middle of my data entry , it is brining someelse data on my screen. I look everywhere i could not find the solution. Please help me Radx
4
5167
by: ramesh_tankala | last post by:
Hi,,,friends.. i am using multiline text box for storing address ,suppose my multiline control(address) is 2nd one,suppose i move from 1st control to 2nd(address) my cursor placed in begining of the text existed in multiline text box(address).i want to cursor end of the text existed in multiline textbox
2
9400
by: King | last post by:
Is there any other way to define multiline text in a XML file: <Help><!]> </Help>
0
10456
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10230
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10012
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7548
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5442
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.