读取Oracle中的clob字段

 int actual = 0;


            string strSql = "select producthtml from web_goods where productsn=835";
            OracleDataReader reader= OraHelper.ExecuteReader(OraHelper.CONN_STRING, CommandType.Text, strSql, null);

            while (reader.Read())
            {

                OracleLob myOracleClob = reader.GetOracleLob(0);

                StreamReader streamreader = new StreamReader(myOracleClob, Encoding.Unicode);
                char[] cbuffer = new char[100];
                while ((actual = streamreader.Read(cbuffer, 0, cbuffer.Length)) > 0)
                {
                    String test = new string(cbuffer, 0, actual);
                    FreeTextBox1.Text += test;
                }

                break;
            }

你可能感兴趣的:(oracle)