当前位置:网站首页>C Oracle multi table query
C Oracle multi table query
2022-06-13 09:50:00 【CSDN Q & A】
Excuse me C# Connect Oracle database , What are the reasons for the errors reported in the multi table Association query , I have no problem with single table query , hold SQL Statement can also find the results when running on the database .
using Oracle.ManagedDataAccess.Client;using System;using System.Collections.Generic;using System.Data;using System.Linq;using System.Text;using System.Threading.Tasks;namespace DeleteOA{ public class OracleHelper { private static string connStr = "User Id=;Password=;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ecology)))"; public static DataTable ExecuteDataTable(string sql, params OracleParameter[] parameters) { using (OracleConnection conn = new OracleConnection(connStr)) { conn.Open(); using (OracleCommand cmd = conn.CreateCommand()) { cmd.CommandText = sql; cmd.Parameters.AddRange(parameters); OracleDataAdapter adapter = new OracleDataAdapter(cmd); DataTable datatable = new DataTable(); adapter.Fill(datatable); //conn.Close(); return datatable; } } } }}
using Oracle.ManagedDataAccess.Client;using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace DeleteOA{ public partial class Form2 : Form { public Form2() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { string flowNumber = "N9999-000006"; string sqlstr = "SELECT WORKFLOW_CODESEQRECORD.REQUESTID,WORKFLOW_NOWNODE.NOWNODETYPE FROM WORKFLOW_CODESEQRECORD,WORKFLOW_NOWNODE WHERE WORKFLOW_CODESEQRECORD.REQUESTID = WORKFLOW_NOWNODE.REQUESTID and WORKFLOW_CODESEQRECORD.WORKFLOWCODE = :flowNumber"; DataTable dt = OracleHelper.ExecuteDataTable(sqlstr, new OracleParameter(":flowNumber", flowNumber)); int i = dt.Rows.Count; } }}
The following are the database query results :
The following are system operation errors :
边栏推荐
- 7-3 virus traceability (20 points)
- Simple use of spiel expressions
- [51nod p2673] shortest path [heap optimization Dijk]
- 程序设计原则
- (topological sorting +bfs) acwing 848 Topological sequence of digraph
- MySQL利用E-R模型的数据库概念设计
- Tree and binary tree: basic operation and implementation of binary tree
- 36氪首发|打造国产精算预测引擎等产品,「深轻科技」连续完成三轮融资
- Analysis and implementation of variable parameters in C language
- Node-RED系列(二五):集成高德地图并实现3d地图和轨迹回放
猜你喜欢
acwing 786. Number k
Classes and objects -- Inheritance
[51nod p3058] Xiao ming'ai set [set]
【 ssl2 ⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶83
Acwing785. quick sort (sort+ quick sort + merge sort)
多线程 从UE4的无锁队列开始 (线程安全)
Tree and binary tree: application of binary tree traversal
[51nod 2493] sum of binary distances [bit operation]
全栈开发实战|SSM框架整合开发
Memory management -- Viewing memory space from the perspective of executing programs and processes
随机推荐
Biden: hope to sign the bipartisan gun safety reform bill as soon as possible
Classes and objects -- polymorphic
List list
WebRTC服务端工程实践和优化探索
[51nod p2653] interval XOR [bit operation]
1-4 message passing interface [CSP authentication]
[Luogu p1403] Research on divisor
【工具链系列】 Notepad++
类文件结构和类加载过程执行引擎简述
【pytorch环境安装搭建】
Protocol UART of schematic diagram
Classical convolutional neural network model
ASCII码值是怎么计算的,怎么计算arccos的值
隐私计算FATE-核心概念与单机部署
Matlab hub motor analysis fuzzy PID control vertical vibration analysis
【 ssl2 ⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶83
[poj1845] sumdiv [number theory]
Node-RED系列(二四):在Node-RED中使用mysql节点实现数据库的增删改查
WIN7无法被远程桌面问题
C# 11 更加实用的 nameof