Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > ASP Forms
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms 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 July 8th, 2003, 11:42 PM
Registered User
 
Join Date: Jul 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to split the commas from the querystring using

hai,

  how to split the commas from the querystring using asp.net, as iam having one problem here is the url look like this:
http://test.aspx/peoplecode=20,40,50,60 i want to write the select query where i can take seperatly each value from the above query string for ex select * from people where peoplecode=40,select * from people where peoplecode=60 and like this how can i do this pls help me out thanks in advance

 
Old July 9th, 2003, 03:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

Code:
    string peoplecode_qry=Request.QueryString["peoplecode"];
    string[] peoplecode_array;
    peoplecode_array = Regex.Split(peoplecode_qry, ",");
    foreach (string peoplecode_item in peoplecode_array)
    {
        qry="SELECT * FROM people where peoplecode=" + Int32.Parse(peoplecode_item);
        //etc...    
    }

HTH.
NNJ

...but the Soon is eclipsed by the Moon
 
Old July 9th, 2003, 04:36 AM
Registered User
 
Join Date: Jul 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks u, but i need it in asp.net it is not working in asp.net i think the code u had given is in c# can u help me out in asp.net

 
Old July 10th, 2003, 08:41 AM
Authorized User
 
Join Date: Jul 2003
Posts: 41
Thanks: 0
Thanked 1 Time in 1 Post
Default

I thought C# was created just for AFS.NET
Anyway C# works well with the .NET framework.

Sorry I know that doesn't answer your question...

 
Old July 18th, 2003, 03:09 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try:

For Each N In Split(Request("peoplecode"),",")
    SQL = "SELECT * FROM people WHERE (peoplecode=" & N & ");"
Next






Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting the continuous commas mrame XSLT 2 July 23rd, 2008 12:46 PM
remove commas and space in a string kumiko Classic ASP Basics 1 January 10th, 2008 11:42 PM
XSLT issue to add commas to values 2BOrNot2B XSLT 3 October 31st, 2006 12:04 PM
ignoring commas in individual fields when parsing clem_c_rock PHP How-To 1 April 20th, 2006 04:14 AM





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