. Net accessing Oracle

Source: Internet
Author: User
Tags dname

Http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html



1.
The following dll must be included during release.
Http://www.189works.com/article-58367-1.html
Or download the xcopy version of Oracle odac and run install. bat all c: \ oracle odac for installation.

2.
You can use EF and paramname for parameterized query.

View code

         Private   Void Button4_click ( Object  Sender, eventargs e ){  VaR Plain text = @" Select E. empno, E. ename, E. hiredate, D. dname from Scott. EMP e inner join Scott. dept D on E. deptno = D. deptno where D. deptno =: deptno  "  ;  VaR CTX = New  Entities ();  VaR List = CTX. executestorequery <empinfo> (plain text, 20  ). Tolist ();}}  Public   Class  Empinfo { Public   Int Empno { Get ; Set  ;}  Public   String Ename { Get ; Set  ;}  Public Datetime hiredate { Get ; Set  ;}  Public  String Dname { Get ; Set  ;}} 

3.
The connection can be written as follows:
String connstring = "Data Source = (description = (address = (Protocol = TCP) (host = 192.168.1.30) (Port = 1521) (CONNECT_DATA = (SID = orcl ))); user ID = Scott; Password = password ;"
You can also do this:
String connstring = "Data Source = 192.168.1.30: 1521/orcl; user id = Scott; Password = password ;"
Log On As administrator:
String connstring = "Data Source = 192.168.1.30: 1521/orcl; user id = sys; Password = admin; DBA privilege = sysdba ;";

4.
You can use Oracle Net configuration assistant to configure the Oracle connection port. If you cannot connect to the port, try this.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.