Author Topic: Analog NextRecordset in C#  (Read 5093 times)

Offline Yulia

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Analog NextRecordset in C#
« on: April 05, 2011, 07:16:20 AM »
Hello, All!

I work with Pivotal 5.9 and i have a problem with getting several recordsets from storage procedure (SQL).
I know in VB6 I can use function NextRecorset.
But I don't know, how can i do it in C#.

if anyone knows, tell me please :)

Best Regards,
Yulia.

Offline serk

  • Full Member
  • ***
  • Posts: 46
  • Karma: +2/-0
    • View Profile
Re: Analog NextRecordset in C#
« Reply #1 on: April 06, 2011, 03:25:08 PM »
Hi Julia,

Not sure if this example could helps to you, but it provide the ability to read data from Oracle DB (using Oracle Data Provider for .NET):

             OracleConnection _sourceDBConnection = new OracleConnection("Data Source=" + "DATABASE_NAME" + ";User ID=" + "USER_ID" + ";Password=" + "PASSWORD");
             _sourceDBConnection.Open();
             OraclCommand _sourceCommand = new OracleCommand();
             _sourceCommand = _sourceDBConnection.CreateCommand();
            _sourceCommand.CommandText = "select * from Product";
            _sourceCommand.Parameters.Clear();

            using (OracleDataReader dr = _sourceCommand.ExecuteReader())
            {
                while (dr.Read())
                {
                            Console.WriteLine(dr["Product_Name"].ToString());
                 }
             }

             _sourceDBConnection.Close();

Hope it helps!

Offline Yulia

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Analog NextRecordset in C#
« Reply #2 on: April 07, 2011, 12:21:51 AM »
Serk,

thank you very much.
The idea I understand. :)