1.String strsql = "SELECT TOP 0 * from" strtblname;
OracleDataAdapter Oraadapter = New OracleDataAdapter ();
Oraadapter.selectCommand = getoracommand (strsql); // new OracleCommand
DataTable DT = New DataTable ();
Oraadapter.fillschema (DT, System.Data.schematype.mapped);
// error: ORA-00923: from キ キ ワ ワ が が が 位置 位置 に あ あ せ.. / N
When using SqlClient, oracle is wrong. why?
A: Oracle uses where rownum = 0
2. Use OracleParameter's SQL statement in 2. Oracle
DataTable dt = new DataTable (); string ConnectString = "server = ibm2d; uid = ibm2d; pwd = ibm2d; Data Source = ibm2d"; string strSQL = "SELECT * FROM JS_KOJIN_TBL WHERE KJNNO =: KJNNO"; // SqlServer in use Kjnno = @Kjnno OracleConnection Conn = New OracleConnection; conn.open ();
OracleCommand cmd = new OracleCommand (strSQL, conn); cmd.CommandType = CommandType.Text; OracleDataAdapter oraAdapter = new OracleDataAdapter (); oraAdapter.SelectCommand = cmd; oraAdapter.SelectCommand.Parameters.Add ( ": KJNNO", OracleType.VarChar, 4, "kjnno"); oraadapter.selectcommand.parameters [": kjnno"]. Value = "1099"; Oraadapter.Fill (DT);