Alternative to patindex in Sql with ASP.net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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).
 
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
 
Back
Top