我正在从我的 vb.net 应用程序调用以下查询到 oracle 服务器,并且在我的 oracle sql 开发人员上执行了相同的查询并正确给出了结果。但是当从下面的 vb.net 代码调用相同的查询时,结果在数据表中出现零行,没有任何异常。
提前致谢。
甲骨文
with sdk as (select roll_no from student where roll_no='1001';)
select * from sdk;
VB
Dim MyconnectionString As String = "provider=MSDAORA.1;data source=student;user id=ss;password=1234;
Dim myOleDbConnection As New OleDbConnection(MyconnectionString)
Dim loDataTable As New DataTable
Dim loCommand As New OleDbCommand
Dim loDataAdapter As New OleDbDataAdapter
loCommand.CommandText = "with sdk as (select roll_no from student where roll_no='1001')select * from sdk;"
loCommand.CommandType = CommandType.Text
loCommand.Connection = myOleDbConnection
loCommand.CommandTimeout = 0
loDataAdapter.SelectCommand = loCommand
loDataAdapter.Fill(loDataTable)