参考:
Pass a BLOB as a Parameter to an Oracle Package by Using the .NET Managed Provider for Oracle
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q322796

解决方案 »

  1.   

    超大文本在数据库里面的存储,使用二进制流
    代码如下:
    //以二进制形式保存文件到变量
    byte[] file_source = new byte[file_size]; //file_size为要保存的对象的大小
    FileStream FileToString =new FileStream(要保存的对象的路径,FileMode.Open);
    BinaryReader br = new BinaryReader(FileToString);
    long count=0;
    while(count < file_size) 
    {
    file_source[count] = br.ReadByte();
    count=count+1;
    }这样file_source就保存了,直接保存到数据库就行了
      

  2.   

    我不知道orcale有没有image类型,
    在SQL中是设置一个字段,类型为image就行了(其实在这个类型可以存储任何东西不仅仅是图片,也可以是超大图片,超大文本…………)
    然后直接把上面代码的file_source二进制数组赋值就可以了思路就是这样的。希望对你有用
      

  3.   

    String2Byte
    System.Text.Encoding.ASCII.GetBytes();
    System.Text.Encoding.Unicode.GetBytes();     
    System.Text.Encoding.UTF8.GetBytes();Byte2String
    System.Text.Encoding.ASCII.GetString();
    System.Text.Encoding.Unicode.GetString() 
    System.Text.Encoding.UTF8.GetString();
      

  4.   

    谢谢vbcb(海波) ,我测试一下~~~
      

  5.   

    想用什么编码格式就用那种格式的编码对象,如果是直接读文件的话,用Stream对象直接获取2进制格式的数据就可以了
      

  6.   

    OleDbConnection myConnection = new OleDbConnection(strConn);
    OleDbCommand myCommand = new OleDbCommand();
    myCommand.CommandType = System.Data.CommandType.StoredProcedure;
    myCommand.CommandText = "ins_news";
    myCommand.Connection = myConnection;

    System.Byte[] byteContent = System.Text.Encoding.Unicode.GetBytes(strContent);     myCommand.Parameters.Add( new OleDbParameter("@i_content", OleDbType.LongVarBinary) );
    myCommand.Parameters["@i_content"].Value = byteContent;try
    {
    myConnection.Open();
    myCommand.ExecuteNonQuery();
    myConnection.Close();
    }
    catch( OleDbException e )
    {
    sucsess = false;
    throw e;
    }报出错误:ORA-01460: 未实现或无理的转换请求 。orcale里面content的类型是long 
      

  7.   

    orcale的类型是long 
    是不是我用OleDbType.LongVarBinary的类型存入不行?