---
title: "How to retrieve data from Oracle db in c#"  
description: "How to retrieve data from Oracle db in c#"  
author: "Manoj Bhatt"  
published: 2016-01-07  
updated: 2016-01-07  
canonical: https://www.mindstick.com/forum/33846/how-to-retrieve-data-from-oracle-db-in-c-sharp  
category: "c#"  
tags: ["c#", "database", "database connection"]  
reading_time: 1 minute  

---

# How to retrieve data from Oracle db in c#

Hi all, \
\
I am new to [Oracle database](https://www.mindstick.com/articles/13115/types-of-keys-in-sql-or-oracle-database) accessing from C#.\
\
I [am trying](https://answers.mindstick.com/qa/36834/which-two-programming-languages-should-i-master-in-if-i-am-trying-to-get-into-google-or-facebook) to access the database of a oracle database named "orcl" from C#.\
\
There is a problem in [connection](https://www.mindstick.com/articles/13012/what-makes-ethernet-connection-better-than-wifi) open. The following is the code I have written under a [click button](https://www.mindstick.com/forum/34274/how-to-pass-combobox-value-from-windows-form-edirrow-to-windows-form-form1-where-click-button):--\
\

```
string oradb = "Data Source=orcl ; User Id=sysman ;Password=abc123;";  /* CODE */                     //string oradb = "Data Source=(DESCRIPTION=" + "(ADDRESS=(PROTOCOL=TCP)(HOST=ORASRVR)(PORT=1521))"     // + "(CONNECT_DATA=(SERVICE_NAME=ORCL)));" + "User Id=hr;     Password=hr;"OracleConnection conn = new OracleConnection(oradb);             conn.Open();  //Open the Connection            /*         other statements                  */            conn.Close();            conn.Dispose();
```

I [am getting](https://www.mindstick.com/forum/34179/i-am-getting-error-while-assigning-the-data-to-the-array-list) the following [exception](https://www.mindstick.com/articles/1824/objective-c-exception-handling):\
"An unhandled exception of type 'Oracle.DataAccess.Client.OracleException' occurred in Oracle.DataAccess.dll\
[Additional information](https://www.mindstick.com/forum/160484/error-failed-to-launch-debug-adapter-additional-information-may-be-available-in-the-output-window): External [component](https://www.mindstick.com/articles/12262/learn-how-to-make-a-component-in-magento-2) has thrown an exception." Please help me to [solve the problem](https://answers.mindstick.com/qa/94744/why-is-google-play-store-not-completing-downloads-and-how-can-i-solve-the-problem).....\
\
Thank you all in advance.


---

Original Source: https://www.mindstick.com/forum/33846/how-to-retrieve-data-from-oracle-db-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
