当前位置:新注册送38元体验金 > 新注册送38元体验金编程 > C#实现Oracle数据库插入clob字段类型数据,

C#实现Oracle数据库插入clob字段类型数据,

文章作者:新注册送38元体验金编程 上传时间:2019-08-22

C#实现Oracle数据库插入clob字段类型数据,

public static void InsertWithLob(OracleConnection conn)
        {
            if (conn!= null && conn.State == ConnectionState.Open)
            {
                try
                {
新注册送38元体验金,                    string sqlText = "insert into tb_nclob(id,name,text) values(1,'test',:text)";
                    using (OracleCommand cmd = new OracleCommand(sqlText, conn))
                    {
                        OracleParameter oracleParameter = new OracleParameter("text", OracleType.Clob);
                        oracleParameter.Value = "this is my test";
                        cmd.Parameters.Add(oracleParameter);
                        int rows = cmd.ExecuteNonQuery();

         cmd.Parameters.Clear();
                        return rows;
                    }
                }
                catch (OracleException ex)
                {
                    throw new Exception(ex.Message);
                }
            }
        }

public static void InsertWithLob(OracleConnection conn) { if (conn!= null conn.State == ConnectionState.Open) { try { string...

本文由新注册送38元体验金发布于新注册送38元体验金编程,转载请注明出处:C#实现Oracle数据库插入clob字段类型数据,

关键词: