Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8694923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:54:15+00:00 2026-06-13T00:54:15+00:00

I have Drop Down List with check box in my asp.net page. in that

  • 0

I have Drop Down List with check box in my asp.net page.
in that page i am going to checked multiple / single / all values.

now i want to pass all selected values from dropdownlist to sql server 2005 stored procedure as parameters.

i want to Pass the array of selected values as a string, each array item separated by a ‘,’

And in stored procedure i want to retrieve each values one by one.
(using split function or any better option ? )

and i want to process insert query on each selected parameters.

any help please.

I have tried This Stored Procedure.

CREATE PROCEDURE [dbo].[TEST_LIST] 
@ID_LIST VARCHAR(200)

AS
DECLARE @pos int,
@nextpos int,
@valuelen int

SELECT @pos = 0, @nextpos = 1

WHILE @nextpos > 0
BEGIN
SELECT @nextpos = charindex(‘,’, @ID_LIST, @pos + 1)
SELECT @valuelen = CASE WHEN @nextpos > 0
THEN @nextpos
ELSE len(@ID_LIST) + 1
END – @pos – 1

  INSERT INTO TABLE 
    (ID)
     VALUES (convert(int, substring(@ID_LIST, @pos + 1, @valuelen)))
  SELECT @pos = @nextpos

END
RETURN
END

BUT IS THIS CORRECT ??

I GOT ERROR.

please note this > one by one i want to retrieve parameters and at each time i have insert query.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:54:17+00:00Added an answer on June 13, 2026 at 12:54 am

    AS ANSWER OF MY QUESTION,
    YOU PLEASE CHANGE YOUR STORED PROCEDURE
    AS SHOWN BELOW.

    CREATE  PROCEDURE SplitList
    @List varchar(500) --list like 1,12,13 or john,12,bobe
    

    AS
    BEGIN

    DECLARE @value varchar(10), @Pos int
    
    SET @List = LTRIM(RTRIM(@List))+ ','
    SET @Pos = CHARINDEX(',', @List, 1)
    
    IF REPLACE(@List, ',', '') <> ''
    BEGIN
        WHILE @Pos > 0
        BEGIN
            SET @value = LTRIM(RTRIM(LEFT(@List, @Pos - 1)))
            IF @value <> ''
            BEGIN
                -- put your code here 
            END
            SET @List = RIGHT(@List, LEN(@List) - @Pos)
            SET @Pos = CHARINDEX(',', @List, 1)
    
        END
    END         
    

    END

    THANKS TO ALL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web flow (asp.net) which has a drop down and a check
I have one drop down list in my page, which contains two options. What
I have a drop down list that has options that need to be passed
I have a drop down list that triggers an updatepanel when the index is
I have a drop-down list hardcoded in an MVC View User Control page and
I have a drop down list that is populated with data in the code
I have a drop down list box like following. Under some condition, in the
Greetings, I have asp.net check box control and asp.net dropdownlist control inside div tag.
I have an ASP.NET MVC Website that has a dropdown list that is being
Hi All I need a CheckBox Dropdown list control in asp.net i have seen

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.