G
Guest
hi,
i have created a connection and using the oracle connection + oracle data adapters,
but when i try to change the select statement and re-fill the datagrid; i get nothing. however, when i fill the data adapter from the data adapter interface/wizard; the datagrid is filled when i run it. what am i missing ? code is below:
Dim conn As New OracleClient.OracleConnection
' TODO: Modify the connection string and include any
' additional required properties for your database.
conn.ConnectionString = OracleConnection1.ConnectionString '"Data Source=<oracle data source name>;Integrated Security=yes"
Try
Dim mycommand As System.Data.OracleClient.OracleCommand
Dim myadapter As New System.Data.OracleClient.OracleDataAdapter
mycommand = New System.Data.OracleClient.OracleCommand
mycommand.Connection = conn
mycommand.CommandText = "select * from master_well_header where iuwi = '60804402080000'"
myadapter = New System.Data.OracleClient.OracleDataAdapter
myadapter.SelectCommand = mycommand
conn.Open()
myadapter.Fill(DataSet11)
DataGrid1.SetDataBinding(DataSet11, "")
Catch ex As Exception
MessageBox.Show("Failed to connect to data source", ex.Message)
Finally
conn.Close()
End Try
i have created a connection and using the oracle connection + oracle data adapters,
but when i try to change the select statement and re-fill the datagrid; i get nothing. however, when i fill the data adapter from the data adapter interface/wizard; the datagrid is filled when i run it. what am i missing ? code is below:
Dim conn As New OracleClient.OracleConnection
' TODO: Modify the connection string and include any
' additional required properties for your database.
conn.ConnectionString = OracleConnection1.ConnectionString '"Data Source=<oracle data source name>;Integrated Security=yes"
Try
Dim mycommand As System.Data.OracleClient.OracleCommand
Dim myadapter As New System.Data.OracleClient.OracleDataAdapter
mycommand = New System.Data.OracleClient.OracleCommand
mycommand.Connection = conn
mycommand.CommandText = "select * from master_well_header where iuwi = '60804402080000'"
myadapter = New System.Data.OracleClient.OracleDataAdapter
myadapter.SelectCommand = mycommand
conn.Open()
myadapter.Fill(DataSet11)
DataGrid1.SetDataBinding(DataSet11, "")
Catch ex As Exception
MessageBox.Show("Failed to connect to data source", ex.Message)
Finally
conn.Close()
End Try