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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:53:26+00:00 2026-06-08T18:53:26+00:00

Sooo, i keep getting the error: ‘object’ does not contain a definition for ‘text’

  • 0

Sooo, i keep getting the error:

‘object’ does not contain a definition for ‘text’ and no extension
method ‘text’ accepting a first argument of type ‘object’ could be
found (are you missing a using directive or an assembly reference?)

for the below code- can anyone tell me why?

    private void cboDataSets_SelectedIndexChanged(object sender, EventArgs e)
    {
        int cats = Int16.Parse(cboDataSets.SelectedItem.text);
        lblGenerateSelection.Text = ("you have selected " + (20 - cats) + "cats you'd like to adopt");
    }
  • 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-08T18:53:27+00:00Added an answer on June 8, 2026 at 6:53 pm

    cboDataSets.SelectedItem will return an object. If it really contains an object that has a .Text property, you have to cast it

    int name = 
        Int16.Parse(((SomeObectWithATextProperty)cboDataSets.SelectedItem).Text);
    

    If SelectedItem is really a string, you can do this instead:

    int name = 
        Int16.Parse(((string)cboDataSets.SelectedItem));
    

    If SelectedItem is an object that has overridden ToString() to display meaningful data, you can do this

    int name = 
        Int16.Parse(cboDataSets.SelectedItem.ToString());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

sooo if i install first visual studio 2008 i get a error, this is
I'm sooo close... but I don't quite see the connection from the upload view
I have tried so many things but I don't understand this sooo confusing. I
This is a homework question. Frankly, I'm not sure how a C program delivers
There are topics about this, but not realy pointed at my problem. I'm using
I need to keep a list(vector) of children for every class, and I've got
I am not sure if this is possible, but I am trying to open
In my android app I call the voice recognition in my onCreate method of
I'm using TINYMCE text editor and if you use a double space the string
I have inherited a webforms application that was working and now is not. The

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.