public void run() { Exception exp = null; OracleDataAdapter oleDBda = new OracleDataAdapter(); try { BeginCase("ToString"); Compare(oleDBda.ToString(), typeof(OracleDataAdapter).ToString()); } catch (Exception ex) { exp = ex; } finally { EndCase(exp); exp = null; } }
/// <summary> /// 将字符串信息初始成数据库查询信息 /// </summary> /// <param name="DBcn">oracle连接</param> /// <param name="TableName">表名</param> /// <param name="condition">条件查询</param> /// <param name="BinaryRec">欲查询信息</param> /// <returns>字符串</returns> public string ReadBinaryToStringDB(OracleConnection DBcn, string TableName, string condition, string BinaryRec) { OracleCommand DBCommand = null; OracleDataAdapter DBAdapter = null; string MySQL = " Select " + BinaryRec + " From " + TableName + " Where " + condition; try { DBCommand = new OracleCommand(MySQL, DBcn); DBAdapter = new OracleDataAdapter(DBCommand); return(DBAdapter.ToString()); } catch (Exception) { return(null); } }