Created
January 13, 2016 23:03
-
-
Save kdeloach/93c74970f52743eb8d39 to your computer and use it in GitHub Desktop.
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
[Test] | |
public void TestBindingsRead() | |
{ | |
string oradb = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=LR14)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=pdborcl.internal.azavea.com)));;User Id=unittest;Password=***;"; | |
string queryString = "SELECT SDE.ST_SRID(SHAPE) || ':' || SDE.ST_AsText(SHAPE) AS SHAPE FROM unittest.DOR_PARCEL_READ WHERE (unittest.DOR_PARCEL_READ.STATUS IN (1, 2))"; | |
using (OracleConnection connection = new OracleConnection(oradb)) | |
{ | |
OracleCommand command = new OracleCommand(queryString, connection); | |
connection.Open(); | |
OracleDataReader reader; | |
reader = command.ExecuteReader(); | |
// Always call Read before accessing data. | |
int i = 0; | |
while (reader.Read()) | |
{ | |
reader.GetString(0); | |
if (++i % 10000 == 0) | |
{ | |
Console.Out.WriteLine(i.ToString()); | |
} | |
} | |
// Always call Close when done reading. | |
reader.Close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment