我使用以下代码连接到我的 oracle 数据库并执行查询。我在示例中使用的查询只是从表中获取一组行。但是,我不断收到“表或视图不存在”的错误消息。但是,我很确定该表存在于数据库中。我哪里错了?
public void UpdateDatabase()
{
System.Data.OracleClient.OracleConnection conn = new System.Data.OracleClient.OracleConnection();
conn.ConnectionString = "Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.5.144)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orcl)));UID=mwm;PWD=mwm";
conn.Open();
OracleCommand command = conn.CreateCommand();
command.CommandText = "Select * from Task";
command.ExecuteNonQuery();
command.Dispose();
}
到达 command.ExecuteNonQuery() 时触发错误。