Created
October 31, 2013 12:24
-
-
Save kiyokura/7248815 to your computer and use it in GitHub Desktop.
ODP.NETでGlimpse.Ado OKのパターン
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Glimpse.Ado OKのパターン | |
// DbFactoryからConnectionをCreateするようにする | |
var factory = System.Data.Common.DbProviderFactories.GetFactory("Oracle.DataAccess.Client"); | |
using (var cn = factory.CreateConnection()) | |
{ | |
cn.ConnectionString = "接続文字列"; | |
cn.Open(); | |
var cmd = cn.CreateCommand(); | |
cmd.CommandText = "select * from hoge"; | |
using (var dr = cmd.ExecuteReader()) | |
{ | |
while (dr.Read()) | |
{ | |
//カラム読むよ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment