相关代码 /// <summary>
/// 返回CLOB数据类型的字符串形式
/// </summary>
/// <param name="sql">查询sql语句</param>
/// <returns>查询到的值</returns>
public string GetSealString(string sql)
{
OracleCommand oraCmd = new OracleCommand();
string ContentBySeal = string.Empty;
try
{
OraOpen();
oraCmd.Connection = ORAConn;
oraCmd.CommandText = sql; OracleDataReader reader = oraCmd.ExecuteReader(); if (reader.Read())
{
OracleLob myLob = reader.GetOracleLob(0);
StreamReader Sreader = new StreamReader(myLob, Encoding.Unicode); int actual = 0;
char[] content = new char[6000];
while ((actual = Sreader.Read(content, 0, content.Length)) > 0)
{
ContentBySeal = new string(content, 0, actual);
}
}
}
catch (OracleException oex)
{
throw new ApplicationException(oex.Message);
}
finally
{
OraClose();
}
return ContentBySeal;
} /// <summary>
/// 获取CLOB字符类型的字符串格式
/// </summary>
/// <returns></returns>
private string GetVise(string BILLNUM,string index)
{
string getCmd = "Select DOCSIGNPIC from ELECSEAL where APPTYPE='MATRECBILL' and SEALGRP like '_"+index+"%' and BILLNUM='" + BILLNUM + "' order by SEALGRP asc;";
string seal = OracleDB.GetSealString(getCmd);
return seal;
}
/// 返回CLOB数据类型的字符串形式
/// </summary>
/// <param name="sql">查询sql语句</param>
/// <returns>查询到的值</returns>
public string GetSealString(string sql)
{
OracleCommand oraCmd = new OracleCommand();
string ContentBySeal = string.Empty;
try
{
OraOpen();
oraCmd.Connection = ORAConn;
oraCmd.CommandText = sql; OracleDataReader reader = oraCmd.ExecuteReader(); if (reader.Read())
{
OracleLob myLob = reader.GetOracleLob(0);
StreamReader Sreader = new StreamReader(myLob, Encoding.Unicode); int actual = 0;
char[] content = new char[6000];
while ((actual = Sreader.Read(content, 0, content.Length)) > 0)
{
ContentBySeal = new string(content, 0, actual);
}
}
}
catch (OracleException oex)
{
throw new ApplicationException(oex.Message);
}
finally
{
OraClose();
}
return ContentBySeal;
} /// <summary>
/// 获取CLOB字符类型的字符串格式
/// </summary>
/// <returns></returns>
private string GetVise(string BILLNUM,string index)
{
string getCmd = "Select DOCSIGNPIC from ELECSEAL where APPTYPE='MATRECBILL' and SEALGRP like '_"+index+"%' and BILLNUM='" + BILLNUM + "' order by SEALGRP asc;";
string seal = OracleDB.GetSealString(getCmd);
return seal;
}
解决方案 »
- 请高手帮忙:怎样在ASP.NET网页中插入一个flash文件
- ASP页面跳转问题~~
- 如何取得出生年月的日期值?
- HttpContext 与Cache
- DataTable 上如何执行sql语句的 group by?多谢!
- 如何计算时间间隔!!!
- 初学问题再发贴:用户控件的调用问题,请高手再指点一下(已经第十天了)
- DropDownList如何只让它显示其中一项?????
- 做对日外包的谈谈体会吧, 如技术增长情况, 加班情况, 项目是否规范,有一定的软件过程 ?
- 帮帮菜鸟
- ViewState("引用站点")=Request.Headers("引用站点")
- Forms登陆验证,为什么我必须登陆两次才成功
的时候 总是报 ORA-00911: 无效字符
Select DOCSIGNPIC from ELECSEAL where APPTYPE='MATRECBILL' and SEALGRP like '_1%' and BILLNUM='1001' order by SEALGRP asc;