How to use query column data as a row in datagridview?

Asked

Viewed 117 times

0

I have a query with 3 columns that bring data from the Oracle database and I want to use one of these columns as row in datagridview.

Are 3 columns name, data and contagem de nomes, and in the column Data has to be a line on datagrid as if it were header and down comes the rest, like column.

Does anyone know how I can do this in c#? I’m making an app winform.

Am I clear? If anyone does not understand me, just let me know that I try to explain again.

Thank you.

1 answer

1

Not if I understood your question correctly, but I believe it would be more or less that within a loop of repetition to fill the table:

var indexCabecalho = dataGridView1.Rows.Add();
var indexPrimeiraColuna = 0;

dataGridView1[indexPrimeiraColuna, indexCabecalho].Value = "Data";

var index = dataGridView1.Rows.Add();

dataGridView1[0, index].Value = "Name";
dataGridView1[1, index].Value = "Contagem";
  • Thank you Richard, I will try to build here and if it works I warning you.

Browser other questions tagged

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