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

推荐订阅源

Martin Fowler
Martin Fowler
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
A
About on SuperTechFans
Vercel News
Vercel News
L
LangChain Blog
B
Blog RSS Feed
Y
Y Combinator Blog
IT之家
IT之家
H
Hackread – Cybersecurity News, Data Breaches, AI and More
GbyAI
GbyAI
V
V2EX
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
阮一峰的网络日志
阮一峰的网络日志
有赞技术团队
有赞技术团队
D
Docker
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
Last Week in AI
Last Week in AI
月光博客
月光博客

博客园 - 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相关文档