Conecting Orcale with c# windows application

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi when i try below code

public DataSet GetData(string ConString)
{

OracleDataAdapter da;
DataSet ds = new DataSet();

// Setup connection string to access Oracle 9i


// Instantiate the connection, passing the
// connection string into the constructo

OracleConnection con = new OracleConnection(ConString);

// Open the connection
con.Open();

// Populate DataSet and close the Database Connection
string sql = "SELECT * From customer";
da = new OracleDataAdapter (sql,con);
da.Fill(ds,"Customer");

// Close the connection
con.Close();
return ds;


}

i get that error
An unhandled exception of type 'System.Exception' occurred in
system.data.oracleclient.dll

Additional information: System.Data.OracleClient requires Oracle client
software version 8.1.7 or greater.

i am using ODBC driver with acces working fine but now i am trying to
convert my application from access to c#..... i got above errors
 
Amjad,

The error is pretty self-explanitory. You need to have the Oracle
Client Software installed, and it must have a version of 8.1.7 or greater.
If you don't want to install that, then I would use the ODBC driver for
Oracle, and use the classes in the System.Data.Odbc namespace instead.

Hope this helps.
 
If you really want to just run and see and not dealing with odbc, you
can select oledb driver for oracle which comes with it.
If you want to use odbc driver, then ditto on Nicholas
Nicholas said:
Amjad,

The error is pretty self-explanitory. You need to have the Oracle
Client Software installed, and it must have a version of 8.1.7 or greater.
If you don't want to install that, then I would use the ODBC driver for
Oracle, and use the classes in the System.Data.Odbc namespace instead.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

amjad said:
Hi when i try below code

public DataSet GetData(string ConString)
{

OracleDataAdapter da;
DataSet ds = new DataSet();

// Setup connection string to access Oracle 9i


// Instantiate the connection, passing the
// connection string into the constructo

OracleConnection con = new OracleConnection(ConString);

// Open the connection
con.Open();

// Populate DataSet and close the Database Connection
string sql = "SELECT * From customer";
da = new OracleDataAdapter (sql,con);
da.Fill(ds,"Customer");

// Close the connection
con.Close();
return ds;


}

i get that error
An unhandled exception of type 'System.Exception' occurred in
system.data.oracleclient.dll

Additional information: System.Data.OracleClient requires Oracle client
software version 8.1.7 or greater.

i am using ODBC driver with acces working fine but now i am trying to
convert my application from access to c#..... i got above errors
 
Back
Top