I want to get the result of a query in my oracle database and put it in a gridview. Now my problem: I have no idea how to output it to gridview. I use gridview from the toolbar and my oracle connection works. I also have the correct query SELECT, and I can list it. I just don't know how to do this in gridview. I searched for it and I came across this: How to populate gridview using mysql? Although this does not help me.
How can I output it to gridview so that it looks exactly like a regular table in oracle database?
What should I use and how?
This is my code:
public void read()
{
try
{
var conn = new OracleConnection("")
conn.Open();
OracleCommand cmd = new OracleCommand("select * from t1", conn);
OracleDataReader reader = cmd.ExecuteReader();
DataTable dataTable = new DataTable();
while (reader.Read())
{
var column1 = reader["vermogen"];
column = (column1.ToString());
listBox1.Items.Add(column);
}
conn.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}