Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 10th, 2006, 04:17 PM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Taking values from textbox

Hi, anyone know how to read the value one by one?

like an email

To: nacy,jack,tom,cat

how do i read the value one by one after the comma sign and insert them to database?

so the result is i will insert

nacy
jack
tom
cat

into the database respectively.please kindly advise. Thanks alot

  #2 (permalink)  
Old February 11th, 2006, 01:13 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You can parse character delimited strings using the String.Split() method.

Here is a VB.NET sample:

Dim myString As String
Dim myStringArray() As String
myString = "nacy,jack,tom,cat"
myStringArray = myString.Split(","c)

Now you can iterate thru the elements of the array and do whatever you like with each value.

-Peter
  #3 (permalink)  
Old February 20th, 2006, 08:29 AM
Authorized User
 
Join Date: Feb 2006
Location: Singupuram, Srikakulam, Andhra Pradesh, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hai friend,

string delimiterStr =",";
char [] delimiter;
string [] split = null;
delimiter = delimiterStr.ToCharArray();
split = date.Split (delimiter);
for(int i =0;i<split.length;i++)
{
Insert the data split[i];
}

Try this. It may help you.

Thanks

Gowtham Sen
  #4 (permalink)  
Old February 20th, 2006, 08:30 AM
Authorized User
 
Join Date: Feb 2006
Location: Singupuram, Srikakulam, Andhra Pradesh, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry change date as your string.
Hai friend,
string mystring = "ram,jaga,sen,gowtham";
string delimiterStr =",";
char [] delimiter;
string [] split = null;
delimiter = delimiterStr.ToCharArray();
split = Mystring.Split (delimiter);
for(int i =0;i<split.length;i++)
{
Insert the data split[i];
}

Try this. It may help you.

Thanks


Gowtham Sen
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
write the values of textbox to a file sandhyamn Pro JSP 1 May 23rd, 2007 10:04 AM
Sum Textbox Values Snuffles ASP.NET 2.0 Basics 1 April 13th, 2007 01:36 PM
Unable to fetch textbox values triveni_sh BOOK: Professional Crystal Reports for VS.NET 0 January 5th, 2006 01:28 AM
concatinating values in textbox crmpicco Javascript How-To 1 July 1st, 2005 09:29 AM
textbox with numerical values must C# 1 August 7th, 2003 12:44 PM



All times are GMT -4. The time now is 06:54 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.