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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:08:51+00:00 2026-05-19T01:08:51+00:00

I am currently building a dynamic url tab system that user can say what

  • 0

I am currently building a dynamic url tab system that user can say what urls they want to be displayed on a tabpage control.

In the database i have the following columns.

userID, int
URLName var
Enabled bit

I am pulling the data back ok but what i am trying do is populate a checkbox list with the urlname and its status on a user options page so they can say what tabs they want displayed.

I have wrote the following methods to get the urls and create the checkboxes however i keep getting the following error.

ex = {“InvalidArgument=Value of ‘1’ is not valid for ‘index’.\r\nParameter name: index”}

It reads the first row ok but when it hits the 2nd row that is being returned i get that error.

Has anyone got any ideas?

Thanks

private void GetUserURLS()
    {

        db.initiateCommand("[Settings].[LoadAllUserURLS]", CommandType.StoredProcedure);

        sqlp = db.addParameter("@UserID", _UserID, SqlDbType.Int, ParameterDirection.Input);
        sqlp = db.addParameter("@spErrorID", DBNull.Value, SqlDbType.Int, ParameterDirection.InputOutput);

        db.executeCommand();

        CreateCheckBoxes(db.getTable(0).Rows);
        db.releaseCommand();
    }


    private void CreateCheckBoxes(DataRowCollection rows)
    {
        try
        {
            int i = 0;
            foreach (DataRow row in rows)
            {
                //Gets the url name and path when the status is enabled. The status of Enabled / Disabled is setup in the users option page
                string URLName = row["URLName"].ToString();
                bool enabled = Convert.ToBoolean(row["Enabled"]);

                CheckedListBox CB = new CheckedListBox();              
                CB.Items.Insert(i, URLName);

                CB.Tag = "CB" + i.ToString();

                checkedListBox1.Items.Add(CB);

                i++;
            }
        }

        catch (Exception ex)
        {
            //Log error
            Functionality func = new Functionality();
            func.LogError(ex);

            //Error message the user will see
            string FriendlyError = "There has been populating checkboxes with the urls - A notification has been sent to development";
            Classes.ShowMessageBox.MsgBox(FriendlyError, "There has been an Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }
  • 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-19T01:08:52+00:00Added an answer on May 19, 2026 at 1:08 am

    You shouldn’t be adding a CheckedListBox as an item to a CheckedListBox. Try just adding the URLName string instead, i.e.

                string URLName = row["URLName"].ToString();
                bool enabled = Convert.ToBoolean(row["Enabled"]);
    
                checkedListBox1.Items.Add(URLName, enabled);
    

    I think that is what you are trying to achieve.

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

Sidebar

Related Questions

I'm currently building a Java app that could end up being run on many
We're currently building an application that executes a number of external tools. We often
I'm currently building a small web application that includes a fair amount of JavaScript.
I'm currently building a Gridview that has expandable rows. Each row contains a dynamically
I am currently building in Version 3.5 of the .Net framework and I have
I am currently building an internal web application used in a factory/warehouse type location.
I am currently building an Excel 2007 Add-in using VSTO (latest version + sp1)
I am currently building a web site and I just implemented SqlCacheDependency using LinqToSQL
I am currently building a small website where the content of the main div
I'm currently building a project and I would like to make use of some

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.