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

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 a line in datagridview .

There are 3 columns name , data and contagem de nomes , and in the Data column there has to be a line in datagrid as if it was header and below comes the rest as column. p>

Does anyone know how I can do this in C #? I'm making an application winform .

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

Thank you.

    
asked by anonymous 04.03.2015 / 19:37

1 answer

1

I do not understand your question well, but I think it would be more or less this 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";
    
04.03.2015 / 19:45