473,397 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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 3004
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

99
by: Paul McGuire | last post by:
There are a number of messages on the python-dev mail list that indicate that Guido is looking for some concensus to come from this list as to what *one* alternative syntax for decorators we would...
28
by: Paul McGuire | last post by:
Well, after 3 days of open polling, the number of additional votes have dropped off pretty dramatically. Here are the results so far: Total voters: 55 (with 3 votes each) Votes for each choice...
4
by: John Winterbottom | last post by:
Hi all Using SQL Server 2000 SP3 on WIn2K Pro with SP2. When I do this SELECT PATINDEX('%%', 'ABC]DEF') GO
11
by: SQL_developer | last post by:
Hello, I am trying to update a column in a table with an 8 digit string. The 8 digit number is obtained from another column which is a comments field. e.g. Comments Field :
1
by: prasaddevivara | last post by:
I am using the outerHTML property to modify the HTML of existin elements in a web page in Internet Explorer. But same outerHTM property is not working in firefox browser, Anybody can tell me a...
3
by: Will McGugan | last post by:
Hi, Is there a naming convention regarding alternative constructors? ie static methods where __new__ is called explicity. I use lower_case for methods in general, but thought maybe CamelCase...
0
by: sachintandon | last post by:
Hello all, Thanks in advance for your help I have a problem in sending emails, my requirement is to send multipart alternative emails with attachments, I'm able to send text with attachments or...
11
by: Francine.Neary | last post by:
I've read that as well as "normal" Java-like function definitions, e.g. int main(int argc, char **argv), you can also choose to use an alternative syntax, i.e. int main(argc, argv) int argc;...
3
by: Phokojoe | last post by:
I have data items separated by commas (,) in several columns of a table in SQL database. When I use the substring and the patindex function, I get the error that 'Msg 536, Level 16, State 3, Line...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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...

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.