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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:52:40+00:00 2026-05-16T08:52:40+00:00

I had Repeater which bind method this method retrieve data from data base by

  • 0

I had Repeater which bind method this method retrieve data from data base by stored procedure when Model_Id pass to this method it retrieve data also user can repeat repeater more than once when user select DDL more than once.I did the code and I add all Model_Ids which user select from DDL in array list but error appear

Cannot convert array list to string value:

protected void Add_Click(object sender, ImageClickEventArgs e)
{
    ArrayList Array = new ArrayList();
    Array.Add(DDLModel.SelectedValue);
    DLHome.DataSource = Cls.GetModelName(Array);
    DLHome.DataBind();
}

public DataTable GetModelName(string Model_Id)
{
    using (SqlConnection conn = Connection.GetConnection())
    {
        SqlCommand cmd = new SqlCommand();
        cmd.Connection = conn;
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "GetComparisonModel";
        SqlParameter ParentID_Param = cmd.Parameters.Add("@Model_Id", SqlDbType.Int);
        ParentID_Param.Value = Model_Id;
        DataTable dt = new DataTable();
        SqlDataAdapter da = new SqlDataAdapter();
        da.SelectCommand = cmd;
        da.Fill(dt);
        return dt;
    }
}
  • 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-16T08:52:40+00:00Added an answer on May 16, 2026 at 8:52 am

    Surely you are getting a compiler error if this is you exact code? GetModelName takes a string as the parameter and you are passing in type ArrayList.

    If you want to convert your array of ID’s to string just have an extension method of ArrayList which iterates over each item and returns the string value e.g.

    public static string ToArrayString(this ArrayList list)
    {
        return String.Join(", ", Cast<string>().ToArray());
    }
    

    Looking at your code, the ArrayList usage appears negligiable as you can simply pass SelectedValue straight into the Bind method.

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

Sidebar

Related Questions

I had Repeater control which had image control sometimes this image control hadnot data
I've never had to do this, but I'm binding a repeater to a generic
I had a function which is pulling all the dates from database against each
Had to download Command Line Tools from Apple to get make to work, but
Had received a module from CCAVENUE and it was working fine with Magento 1.6.2...
Had a problem with the recursive conflictCheck() method. That seems fine now. I have
Had this working; at one stage. The problem is the following text is now
I've had a bit of a problem trying to bind a generic list to
I've been kinda stuck in trying to organize data and bind them to a
I am trying to simply bind a HTML Input radio button inside a repeater

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.