Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF - Binding to Oracle database

In WPF, how is binding to an Oracle database achieved?

Existing solutions

  1. Linq (all 3 required)
    • Simple Demo of Binding to a Database in WPF using LINQ-SQL
    • Using LINQ to SQL with Oracle
    • Building a LINQ Provider
  2. ADO.net
    • http://erkapeblog.blogspot.com/2010/05/data-binding-and-adonet-in-wpf.html
  3. ODAC
    • not sure how

It'll also help if you have tried any of the above approaches and have links to them.

like image 586
mauryat Avatar asked Aug 28 '26 04:08

mauryat


1 Answers

I tried the 2nd solution (ADO.net) that I listed in the question and it worked!

Steps to follow

  1. Install an Oracle client (I used Oracle 11g). Apparently, an instant client can also be used.
  2. Follow the steps in this article.
  3. Small typo in the article: The name of the ListBox is incorrectly referred in code as listBox instead of listID.
  4. Connection String that worked for me (source):

SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));uid=myUsername;pwd=myPassword;

like image 182
mauryat Avatar answered Aug 30 '26 09:08

mauryat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!