I'm trying to run a query on a oracle database using a join or union or multiple tables. Store that information into a reader then bind it to a dataset and fill a gridview. I might be going about this all wrong but it works with a single table, just not when I query two tables
I make my connection fine with ODBCCOnnection
then I create my query
I'm getting all the columns i want from table 1 but none from table 2.
How do I go about getting table 2 in the gridview if possible?
I make my connection fine with ODBCCOnnection
VB.NET:
Dim ODistConStr As String = "Driver={Microsoft ODBC for Oracle};Server=" etc etc"
Dim ODistdbCon As New Odbc.OdbcConnection(ODistConStr)
then I create my query
VB.NET:
Dim query as String = "select a.column1, b.column1, a.column2 from table1 inner join table2 on a.column1 = b.column2
Dim sqlCmd As New Odbc.OdbcCommand(query, ODistdbCon)
Dim reader As Odbc.OdbcDataReader = sqlCmd.ExecuteReader()
reader.fill(ds, "table1")
Me.Gridview.Datasource = ds
Me.GridView1.DataBind()
I'm getting all the columns i want from table 1 but none from table 2.
How do I go about getting table 2 in the gridview if possible?
Last edited: