DB Sample Code Request

  • Thread starter Thread starter Tony
  • Start date Start date
T

Tony

Would anyone be able to help me with the most bare-boned as possible
code to connect to an oracle database and do a sql query and load the
data into a an array?

I have Oracle 9i client installed and expect it to be installed on any
machine running the app. (Along with win2k or XP Pro)

Trying to self-learn C# and an example of the above would help me
re-write a VB6 app I did in the past to C# as a learning tool :)

Thanks for any assistance. :)

Tony!
 
hi tony
you can find exactly what you need on this link

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/
vbtskcreatingconnectiontooracledatabase.asp

just a quick discription of what you will be doind , you need an
OleDbConnection object to connect to an oracle 9i database
then you need an OleDbDataAdabter to get data from your database . if you
are going to use the connected modle then you would need a datareader and
use it get the data after execting an OleDbCommand on the database .
however , you can use the disconnected modle and use the adapter to fill a
dataset , then you would do all the modification on the dataset and later
update thet database , the MSDN artical would explain more
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Back
Top