报错如下:CLOB and NCLOB require even number of bytes for this argument. Parameter name: count 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentOutOfRangeException: CLOB and NCLOB require even number of bytes for this argument. Parameter name: countSource Error:                                      byte[] tempbuff = System.Text.Encoding.Default.GetBytes(Request["Content"].ToString());
                                     //创建临时lob 代码略
                                     ...
Line 138: OracleLob tempLob = (OracleLob)cmd.Parameters[0].Value;
Line 139: tempLob.BeginBatch(OracleLobOpenMode.ReadWrite);
Line 140: tempLob.Write(tempbuff,0,tempbuff.Length);
Line 141: tempLob.EndBatch();
Line 142: cmd.Parameters.Clear();
140行出错.
请教..

解决方案 »

  1.   

    this.oracleConnection1.Open();
    try
    {

    OracleCommand cmd = new OracleCommand();
    cmd.Connection=this.oracleConnection1;
    cmd.CommandText="insert into lsa_table (iidd,EDITTEMPLATE2,HTMLTEMPLATE)values(get_guid(sys_guid()),:aa,:bb)";

    cmd.Parameters.Add("aa",OracleType.Clob,System.Text.Encoding.Default.GetByteCount(this.textBox1.Text)).Value=this.textBox1.Text;
    cmd.Parameters.Add("bb",OracleType.Clob,System.Text.Encoding.Default.GetByteCount(this.textBox2.Text)).Value=this.textBox2.Text; cmd.ExecuteNonQuery();
    }
    catch(System.Exception ex)
    {
    MessageBox.Show(ex.ToString());
    }
    this.oracleConnection1.Close();