Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 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 June 1st, 2006, 07:27 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using C# with Oracle

Hi,

I am using Oracle 9i as a backend for the first time, I dont know how to make the connection and how to pass the query string to enter into the database from the text boxes.
Please send me whole code how to enter the values into database using Oracle connection string.

Thanks
Lily

 
Old June 1st, 2006, 09:56 AM
Authorized User
 
Join Date: Feb 2006
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to MAKO
Default

Hi Lily, lest's see how far we get with this.

first you must declare oracle namespace with...:

using System.Data.OracleClient;

create the connection string in order to create the connection:

private const string ConnectionString = "DataSource=MyOracleDB; Integrated Security=yes;";

now create the oracle connection:

OracleConnection MyConnection = new OracleConnection(ConnectionString);

from this you can pass your textboxes' data to variables that are then passed as part of a sort of SQL SELECT statement, I think (not very familiar with oracle) and insert data to your DB with a dataAdapter.

Hope this helps you find the way.

MAKO - "El super simio"
 
Old June 5th, 2006, 07:37 AM
Authorized User
 
Join Date: Apr 2006
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to vivekshah Send a message via Yahoo to vivekshah
Default

The answer u got is correct & will help u out.

but that is if ur using the provider Of Oracle.

CAn u tell me what provider u would b using.


Vivek Shah
 
Old June 5th, 2006, 07:46 AM
Authorized User
 
Join Date: Apr 2006
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to vivekshah Send a message via Yahoo to vivekshah
Default

Lily

If u want using Oledb
U can wirte the connection string as

Code:
using System.Data.Oledb;

private string = "Provider=MSDAORA;User id = abc;password=xyz;data source=kkkk";
Hope this works if u working thru Oledb.

Vivek Shah





Similar Threads
Thread Thread Starter Forum Replies Last Post
Oracle SOA, BPEL and Oracle worklist umeshtheone Pro Java 1 April 16th, 2008 11:01 PM
call oracle function using oracle link server vl SQL Server 2000 1 July 12th, 2007 08:19 AM
How to Read Oracle Data without Oracle being insta badrinarayanang Oracle 1 October 6th, 2005 06:34 AM
Connecting to Oracle without Oracle Client mahaveerar VB Databases Basics 0 February 22nd, 2005 05:18 PM
Connecting to Oracle without Oracle Client mahaveerar Excel VBA 0 February 22nd, 2005 03:55 PM





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