和存储过程可能没关系,你直接用sql语句看看行不

解决方案 »

  1.   

    该存储过程在本地是没有任何问题的。
    具体的调用方法如下:
    1,Remoting客户端方法:
    //IOracleData是一接口
    TcpChannel chan = new TcpChannel();
    ChannelServices.RegisterChannel(chan);
    IOracleData oracle=(IOracleData)Activator.GetObject(typeof(IOracleData),
    "tcp://zhangyc-060:8085/FormatOracleData");
    2,调用方法:
    OracleParameter mino=new OracleParameter("mino",OracleType.Char,3);
    mino.Value ="101";
    OracleParameter capa=new OracleParameter ("capacity",OracleType.Int32 );
    capa.Direction =ParameterDirection.Output ;
    oracle.ExecuteProcedure ("Test",mino,capa);
    int a=(int)capa.Value ;请各大侠指点。
      

  2.   

    To xiaha3(夏):
      直调执行一条Delete语句没有问题。
      

  3.   

    没有用到attribute,不知用哪个好.
      

  4.   

    据调试,只是不能传递OracleParameter类型的参数,其它没问题,
    如何才能传递OracleParameter类型的参数进去.
      

  5.   

    .NET Remoting - Changes for .NET 1.1 / Visual Studio 2003
    With the introduction of version 1.1 of the .NET Framework, a number of Remoting-related changes have been made. Most of them are focused at increasing security of .NET applications and I therefore consider them A Good Thing. Unfortunately though, they broke a number of samples in my books (and in all the other Remoting books out there).If you use client activated objects, events or delegates you will quite likely encounter one of the following exceptions when running on the .NET Framework 1.1:System.Security.SecurityException. 
    Type System.DelegateSerializationHolder and the types derived from it (such as System.DelegateSerializationHolder) are not permitted to be deserialized at this security level. 
    System.Runtime.Serialization.SerializationException
    Because of security restrictions, the type System.Runtime.Remoting.ObjRef cannot be accessed. 
    To change the security level to allow passing of delegates and object references over Remoting boundaries, you have to change the so called "typeFilterLevel". You can do this either by using a configuration file like this (for server side):<configuration>
     <system.runtime.remoting>
      <channel ref="http" port="1234">
       <serverProviders>
         <provider ref="wsdl" />
         <formatter ref="soap" typeFilterLevel="Full" />
         <formatter ref="binary" typeFilterLevel="Full" />
       </serverProviders>
       <clientProviders>
        <formatter ref="binary" />
       </clientProviders>
      </channel>
      <service>
        <!-- ... Add your services here ... -->
      </service>
     </system.runtime.remoting>
    </configuration>
    In this case, a matching client-side configuration file which allows the reception of events and callbacks, would look like this:<configuration>
     <system.runtime.remoting>
      <channel ref="http" port="0">
       <clientProviders>
         <formatter ref="binary" />
       </clientProviders>
       <serverProviders>
         <formatter ref="binary" typeFilterLevel="Full" />
       </serverProviders>
      </channel>
      <client>
        <!-- ... Add your classes here ... -->
      </client>
     </system.runtime.remoting>
    </configuration>
    If you prefer to setup your channels in source code, you have to use the extended constructor of the HttpChannel or TcpChannel to pass a custom IFormatterSinkProvider object:BinaryServerFormatterSinkProvider serverProv = new BinaryServerFormatterSinkProvider();
    provider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;BinaryClientFormatterSinkProvider clientProv = new BinaryClientFormatterSinkProvider();IDictionary props = new Hashtable();
    props["port"] = 1234;HttpChannel chan = new HttpChannel(props, clientProv, provider);        
    ChannelServices.RegisterChannel( chan );
      

  6.   

    try this one:http://groups.google.com/groups?hl=zh-CN&lr=&ie=UTF-8&oe=UTF-8&threadm=2cce01c2b812%24938c9020%2489f82ecf%40TK2MSFTNGXA01&rnum=1&prev=/groups%3Fq%3DSystem.runtime.remoting.objref%2B2003%26hl%3Dzh-CN%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D2cce01c2b812%2524938c9020%252489f82ecf%2540TK2MSFTNGXA01%26rnum%3D1
      

  7.   

    非常感谢colin666(边缘).
    按照上面的贴子,我的代码如下:
    1,Remoting's Assembly:
      增加了强名称和APTCA的Attribute2,服务器端的代码:
      //从配置文件中读取信道参数
      int channel=int.Parse (ConfigurationSettings.AppSettings["channel"]);
      BinaryServerFormatterSinkProvider provider = new BinaryServerFormatterSinkProvider();
      provider.TypeFilterLevel = TypeFilterLevel.Full;
      IDictionary port = new Hashtable();
      port["port"] =channel;
      TcpChannel chan = new TcpChannel(port,null,provider);
      ChannelServices.RegisterChannel(chan);
      RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemotingServer.FormatOracleData ), "OracleData", WellKnownObjectMode.SingleCall);
      System.Console.WriteLine("点击 <enter> 退出...");
      System.Console.ReadLine();
    3,客户端代码:
      BinaryServerFormatterSinkProvider provider = new BinaryServerFormatterSinkProvider();
      provider.TypeFilterLevel = TypeFilterLevel.Full;
      TcpChannel chan=new TcpChannel(null,null,provider);
      ChannelServices.RegisterChannel(chan);
      IOracleData oracle=(IOracleData)Activator.GetObject(typeof(IOracleData),
    "tcp://zhangyc-060:8085/OracleData");
    4,方法调用:
      从服务器中调用DataSet GetDataSet(string sql)没有作何问题.
      DataSet ds=oracle.GetDataSet ("Select * from stand_mi");
      this.dataGrid1 .DataSource =ds.Tables [0].DefaultView ;
      在服务器中执行存储过程方法出错,void ExecuteProcedure(string name,params parameters)
      OracleParameter Machine=new OracleParameter ("MACHINENO",OracleType.Char,6);
      Machine.Value ="F392";
      OracleParameter Result=new OracleParameter ("Result",OracleType.Number ,4);
      Result.Direction =ParameterDirection.Output ;
      oracle.ExecuteProcedure ("CELL_NAMES_RECOVER_MACHINE",Machine,Result);
      出错信息为:此远程处理代理没有信道接收,这意味着服务器没有正在侦听的已注册服务器信道,或者此应用程序没有用来与服务器对话的适当客户端信道。请众大侠指点.
    谢谢!