为了从 SQL Server 数据库中获取数据,我可以使用如下代码
Dim sql As String = "SELECT emp_id, emp_name FROM emp; SELECT dep_id, dep_name FROM department;"
Dim da As New SqlClient.SqlDataAdapter(sql, connString)
Dim ds As New DataSet("Data")
da.Fill(ds)
我将在ds数据集中得到两个表。如何为 Oracle 数据库编写相同的代码?我尝试按上述方式编写代码,但收到错误消息。ORA-00911: 无效字符
此外,我还想使用 DELETE 语句。例如
Dim sql As String = "DELETE FROM emp WHERE emp_id = 1; DELETE FROM department WHERE dep_id = 4"
Dim cmd As New SqlCommand(sql, conn)
cmd.ExecuteNonQuery()
谢谢你。