469,955 Members | 1,442 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,955 developers. It's quick & easy.

Alternative to patindex in Sql with ASP.net

Can someone please tell me if there is an alternative to patindex in ASP.net.

The reason why i need it is because, i want to create a textbox to let users
enter lots of words and the words will be divided by a comma. I'm also going
to provide a button and when the button is pressed, i want the script to
separate all words within the textbox and save them as different rows in an
SQL server table.

Regards

Please help, it is very urgent

Daniel.
Apr 3 '07 #1
2 2872
See the String.Split method. You could use this application side and fill
the DB with already processed data.

Another option is to create a Split function in SQL Server (googling for
fn_Split should allow to retrieve the code for some of theses).
---
Patrice

"Daniel" <Da****@discussions.microsoft.coma écrit dans le message de news:
F9**********************************@microsoft.com...
Can someone please tell me if there is an alternative to patindex in
ASP.net.

The reason why i need it is because, i want to create a textbox to let
users
enter lots of words and the words will be divided by a comma. I'm also
going
to provide a button and when the button is pressed, i want the script to
separate all words within the textbox and save them as different rows in
an
SQL server table.

Regards

Please help, it is very urgent

Daniel.

Apr 3 '07 #2
On Tue, 3 Apr 2007 05:06:02 -0700, Daniel wrote:
Can someone please tell me if there is an alternative to patindex in ASP.net.

The reason why i need it is because, i want to create a textbox to let users
enter lots of words and the words will be divided by a comma. I'm also going
to provide a button and when the button is pressed, i want the script to
separate all words within the textbox and save them as different rows in an
SQL server table.

Regards

Please help, it is very urgent

Daniel.
The nearest alternative to the patindex is the IndexOf method of the string
object. However this might not be the best way to do it.

If you are sure the words will always be divided by commas, string.split()
should do it for you. If however the separating characters may vary,
regex.split() may be your best bet
--
Bits.Bytes
http://bytes.thinkersroom.com
Apr 3 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

99 posts views Thread by Paul McGuire | last post: by
4 posts views Thread by John Winterbottom | last post: by
11 posts views Thread by SQL_developer | last post: by
3 posts views Thread by Will McGugan | last post: by
11 posts views Thread by Francine.Neary | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.