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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:13:58+00:00 2026-06-17T06:13:58+00:00

I am using the next code. public void MostrarCombobox(ComboBox cmbIDart) { Command = SELECT

  • 0

I am using the next code.

   public void MostrarCombobox(ComboBox cmbIDart)
   {
       Command = "SELECT idArtigoAvaliar FROM dbo.PorAvaliasao WHERE (avaliado = 0) AND (idAutor ='" + Autor.id2 + "')";

       SqlCommand Comm1 = new SqlCommand(Command, Conn);
       SqlDataAdapter data = new SqlDataAdapter(Comm1);

       SqlCommand sqlCommand = new SqlCommand();

       using (Conn)
       {
           sqlCommand = Conn.CreateCommand();

           sqlCommand.CommandText = Command;

           SqlDataAdapter sda = new SqlDataAdapter(sqlCommand.CommandText, Conn);

           SqlCommandBuilder scb = new SqlCommandBuilder(sda);

           //Criar uma tabela para receber os dados
           DataTable dTable = new DataTable();

           //Preencher a tabela
           sda.Fill(dTable);

           BindingSource bSource = new BindingSource();
           bSource.DataSource = dTable;
           cmbIDart.DataSource = bSource;

           Conn.Close();
       }

   }

My problem is that when I am starting to call the ComboBox, it shows System.Data... and I want them to show the value.

What am I doing wrong?

  • 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-17T06:14:00+00:00Added an answer on June 17, 2026 at 6:14 am

    I think in your combobox rows look like showing like;

    System.Data.DataRowView
    System.Data.DataRowView
    System.Data.DataRowView
    System.Data.DataRowView
    System.Data.DataRowView
    

    You need to set your Combobox DisplayMember and ValueMember properties.

    If this is not fix your problem, try to make things more clear dynamically.

    Combobox1.Items.Clear();
    
    string Command = "SELECT idArtigoAvaliar FROM dbo.PorAvaliasao WHERE (avaliado = 0) AND (idAutor ='" + Autor.id2 + "')";
    
    SqlCommand cmd = new SqlCommand(Command, Conn);
    cmd.CommandText = Command;
    
    SqlDataReader dr = cmd.ExecuteReader();
    while (dr.Read())
    {
       Combobox1.Items.Add(dr["idArtigoAvaliar"].ToString());
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the next code : #include <iostream> using namespace std; class A { public:
I try to send a sms using next code, but recipient gets my message
I am using the next lines of code to transform Path object and draw
I got next code: private Dictionary<int?, byte[]> GetAllLocalScanFiles() { using (DZine_IStylingEntities ctxLocal = new
I'm interested in using a code coverage tool for my next .NET project but
I am using this code: $('.ui-accordion').bind('accordionchange', function(event, ui) { $(this).next().next().css({'background-image':'images/green-bg.jpg'}); //ui.newHeader // jQuery object,
I am using the next instructions to get some registers from my Database. Create
thats part of my code: public List<Integer> _list = new ArrayList<>(); public void removeInteger(Integer
I have some code like this: public void SaveImage(int Counter) { var task =
can not reproduce deadlock using the next code I am trying yo get a

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.