Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle ASP
|
Oracle ASP Using ASP with Oracle databases. For Oracle discussions not specific to ASP, please see the Oracle forum. For more ASP discussions, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 27th, 2004, 06:23 AM
Authorized User
 
Join Date: Aug 2004
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to macupryk Send a message via Yahoo to macupryk
Default C# create an odbc connection?

Question revised:

Hi folks,

I have to connect to an oracle db 9.2 that is on a sun sparc through windows 2003 server. I downloaded all the odbc drivers. I can connect to the database with the oracle client software. However, I need to create a odbc connection in C# to the DB. Anyone can help me or point me to a sample application. I would really appreciate it.


Knowledge is to be shared.
__________________
Knowledge is to be shared.
 
Old December 8th, 2004, 06:55 AM
Registered User
 
Join Date: Dec 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

string connectionString = " "; //Enter the connection string.
System.Data.Odbc.Connection connection = new System.Data.Odbc.OdbcConnection(connectionString);
System.Data.Odbc.OdbcCommand command = new System.Data.Odbc.OdbcCommand;

command.Connection = connection;
System.Data.Odbc.OdbcDataAdapter adapter = new System.Data.Odbc.OdbcDataAdapter(command);
adapter.SelectCommand.CommandText = ""; //enter the sql select command string.
System.Data.DataSet dataSet = new DataSet();
adapter.Fill(dataSet);







Similar Threads
Thread Thread Starter Forum Replies Last Post
Sql vs Odbc Connection vgsgowrisankar C# 2005 6 April 10th, 2008 08:14 AM
ODBC DSN connection atoyot BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 2 December 14th, 2006 06:40 PM
Need Help with ODBC connection johnjohn Visual C++ 2 December 7th, 2004 01:11 PM
ODBC Connection abilodeau Access 3 September 22nd, 2004 09:05 PM
ODBC connection mishaq SQL Server 2000 13 June 16th, 2004 02:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.