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 5998869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:28:01+00:00 2026-05-23T00:28:01+00:00

I am using asp.net with vb.net. I have created 2 listboxes; lstselect and lstroles.

  • 0

I am using asp.net with vb.net. I have created 2 listboxes; lstselect and lstroles. List boxes lstselect contains all of the available roles that can be added into lstroles. How do I take the roles that have been added into lstroles and make them into a parameter to pulled into my database when the stored procedure runs?

Here is the code for how my list boxes share the roles:

Protected Sub btnRight_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRight.Click
    If lstselect.SelectedIndex <> -1 Then
        lstroles.Items.Add(lstselect.SelectedItem.Text)
        lstselect.Items.Remove(lstselect.SelectedItem.Text)
    End If
End Sub

Protected Sub btnLeft_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLeft.Click
    If lstroles.SelectedIndex <> -1 Then
        lstselect.Items.Add(lstroles.SelectedItem.Text)
        lstroles.Items.Remove(lstroles.SelectedItem.Text)
    End If
End Sub

Thanks!

  • 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-05-23T00:28:02+00:00Added an answer on May 23, 2026 at 12:28 am

    There are two ways to do it:

    1) Create a Comma Separated Values from Your List Box Selected Items. But this is not a recommended Approach, as you need to parse it in your Stored Procedure.

    string commaSeparatedParams = string.Join(",", myArray);
    

    2) Create an XML, each Role would be a Node. And Pass XML as your Stored Procedure Parameter. Most Databases Support Easily retrieving Data from XML. btw, Which Database are you using?

    3) If you are using MS SQL 2008, you can also use Table-Valued Parameters : http://msdn.microsoft.com/en-us/library/bb510489.aspx

    but its only recommended for Bulk Insert kind of operations. The Recommended approach for you is XML, i would say.

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

Sidebar

Related Questions

We have created a web application, using ASP.NET, that allows users to upload documents
Using the client-side ASP.NET AJAX library, I have created an instance of a client
I'm using asp.net/c# and have a number of Collapsible Panel Extenders that have been
I am using asp.net MVC to develop an application that will have ajax interactions.
I have created a site using asp.net mvc3 and I have some action in
i have created a MVC application , without using asp.net membership provider, i want
I am using asp.NET 4.0 with C# and have recently created a custom design
I am in the start up of a project using ASP.NET MVC and have
Using asp.net, I need to generate a snapshot of an youtube video. I have
I have been using ASP.NET for years, but I can never remember when using

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.