惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
MongoDB | Blog
MongoDB | Blog
GbyAI
GbyAI
L
LangChain Blog
B
Blog
博客园 - 三生石上(FineUI控件)
Martin Fowler
Martin Fowler
博客园 - 【当耐特】
Recent Announcements
Recent Announcements
P
Proofpoint News Feed
U
Unit 42
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
雷峰网
雷峰网
Microsoft Security Blog
Microsoft Security Blog
T
The Blog of Author Tim Ferriss
爱范儿
爱范儿
小众软件
小众软件
I
InfoQ
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
C
Check Point Blog

博客园 - ZH.net

在vb.net中通过ODBC从Oracle 9i向Access倒数据 从SQLSERVER向ORACLE8迁移的技术实现方案 Part V [转] 从SQLSERVER向ORACLE8迁移的技术实现方案 PartIV [转] 从SQLSERVER向ORACLE8迁移的技术实现方案 PartIII [转] 从SQL SERVER向ORACLE的迁移方案[转] PartII Sql Server 转入 Oracle part I (转自网络) 在 .NET 中使用 Oracle 数据库事务 作者:Jason Price 转自oracle.com Oracle Trigger(转自网络) Oracle的分页以及sequence 一些正则表达式 - ZH.net - 博客园 将文件(word,excel等)存入oracle的一个字段 .net studio 2005操作dbf文件 Web利用Gloabl.asax实现多线程任务 maintain AD(将一个账号移动到另一个群组) 一個Check AD的类。from MSDN 一些JS ViewState的一些学习笔记 发mail时smtp服务器设置的一个问题 datagrid前加checkbox
接昨日,将上传至oracle的excel文件下载下来
ZH.net · 2006-03-14 · via 博客园 - ZH.net

代码如下
try
        {
            DBHelper db = DBHelper.DBHelperInstance(System.Configuration.ConfigurationSettings.AppSettings["DataBaseType"]); ;
            OracleConnection oconn = new OracleConnection(db.pcsConnectionString);
            oconn.Open();

            string strSQL = "select DOC from exceltodb where fileid='1112'";
            OracleCommand OCMD = new OracleCommand(strSQL, oconn);
            OracleDataReader Ord = OCMD.ExecuteReader(CommandBehavior.SequentialAccess);
            int bufferSize = 100;
            byte[] outbyte = new byte[bufferSize];
            long retval;                            // The bytes returned from GetBytes.
            long startIndex = 0;
            Response.AddHeader("Content-Type", "application/vnd.ms-excel");
            Response.AddHeader("Content-Disposition", "attachment;filename=test.xls");
            if(Ord.Read())
            {
                // Reset the starting byte for the new BLOB.
                startIndex = 0;

                // Read the bytes into outbyte[] and retain the number of bytes returned.
                retval = Ord.GetBytes(0, startIndex, outbyte, 0, bufferSize);

                // Continue reading and writing while there are bytes beyond the size of the buffer.
                while (retval == bufferSize)
                {
                    this.Response.BinaryWrite(outbyte);
                    this.Response.Flush();

                    // Reposition the start index to the end of the last buffer and fill the buffer.
                    startIndex += bufferSize;
                    retval = Ord.GetBytes(0, startIndex, outbyte, 0, bufferSize);
                }

                // Write the remaining buffer.
                this.Response.BinaryWrite(outbyte);
                this.Response.Flush();
             }
             Ord.Close();
             oconn.Close();
                this.Response.End();
           }
           catch(Exception ex)
           {
             this.Response.Write("<b>ex.Message</b>");
           }
           finally
           {
            
            }

参考自CSDN相关文档