How can I convert values. Row to string and insert into a combobox? C#

Asked

Viewed 37 times

0

I have the following code:

for(int i = 1; i<dataTable.Rows.Count; i++)
{comboBox.Items.Add( dataTable.Rows[i].ToString());}

When I run the application, in combobox just appears to me System.Data.DataRow. I wish I could see all the items on the combobox.

  • 2

    Wouldn’t that be: dataTable.Rows[i]["nome_da_coluna"].ToString() ?

  • Thank you, silly thing XD

  • 1

    I’m voting to close because the question has been answered in the comments and it’s been two years since an answer was posted.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.