Wrox Programmer Forums
|
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
 
Old February 10th, 2006, 04:17 PM
Authorized User
 
Join Date: Jan 2006
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

 
Old February 11th, 2006, 01:13 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
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
 
Old February 20th, 2006, 08:29 AM
Authorized User
 
Join Date: Feb 2006
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
 
Old February 20th, 2006, 08:30 AM
Authorized User
 
Join Date: Feb 2006
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





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





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