小编use*_*719的帖子

"ORA-01036:C#中oracle clob的非法变量名/数字\n"

当我尝试使用clobC#中的输入和输出创建一个oracle存储过程调用时,我收到以下错误:

ORA-01036: illegal variable name/number\n
Run Code Online (Sandbox Code Playgroud)

这是代码本身:

OracleTransaction transaction = connection.BeginTransaction();
OracleCommand command = connection.CreateCommand();
command.Transaction = transaction;
command.CommandText = 
      @"declare xx clob; 
      begin dbms_lob.createtemporary(xx, false, 0); 
      :tempclob := xx; end;";

command.Parameters.Add(new OracleParameter("tempclob", OracleType.Clob))
    .Direction = ParameterDirection.Output;

command.ExecuteNonQuery();

OracleLob tempLob = (OracleLob)command.Parameters[0].Value;
//byte[] tempbuff = new byte[10000];
byte[] tempbuff = System.Text.Encoding.Unicode.GetBytes(generateXMLMessage());

tempLob.BeginBatch(OracleLobOpenMode.ReadWrite);
tempLob.Write(tempbuff, 0, tempbuff.Length);
tempLob.EndBatch();
command.Parameters.Clear();
command.CommandText = "InsertMessageAndGetResponseWRP";
command.CommandType = CommandType.StoredProcedure;
//command.Parameters
//.Add(new OracleParameter("ImportDoc", OracleType.Blob)).Value = tempLob;
command.Parameters.Add(new OracleParameter("iSourceSystem", OracleType.VarChar))
       .Value = "XXX";

command.Parameters.Add(new OracleParameter("iMessage", OracleType.Clob))
       .Value …
Run Code Online (Sandbox Code Playgroud)

c# oracle clob

9
推荐指数
1
解决办法
2万
查看次数

抽象类中的公共事件

我在抽象类中声明了事件:

public abstract class AbstractClass
{
    public event Action ActionEvent;
}

public class MyClass : AbstractClass
{
    private void SomeMethod()
    {
        //Want to access ActionEvent-- Not able to do so
        if (ActionEvent != null)
        {
        }

    }
}
Run Code Online (Sandbox Code Playgroud)

我想在派生中访问此基类事件.此外,我想在MyClass的其他派生类中访问此事件:

MyClass.ActionEvent += DerivedMethod()
Run Code Online (Sandbox Code Playgroud)

请帮助我了解如何使用抽象类中定义的事件.

c# events delegates abstract-class action

5
推荐指数
2
解决办法
6180
查看次数

标签 统计

c# ×2

abstract-class ×1

action ×1

clob ×1

delegates ×1

events ×1

oracle ×1