Last post Sep 07, 2016 10:45 AM by Yohann Lu
Sep 01, 2016 10:09 AM|Nadeem157|LINK
Sep 01, 2016 10:25 AM|balu.devara|LINK
use bellow code.
using(OracleCommand commandrepeat1 = new OracleCommand("Select * from XXCUS.XXACL_PN_FARMING_MST where project=" + proj + " and Survey=" + surv + " "))
string constr = ConfigurationManager.ConnectionStrings["OracleConn"].ConnectionString;
OracleConnection con = new OracleConnection(constr);
drmax1 = commandrepeat1.ExecuteReader();
Sep 07, 2016 10:45 AM|Yohann Lu|LINK
From your error message, you have some error in your connection code. I suggest you can use Using statement when you operate the database.
The purpose of Using statement is that when control will reach end of using it will dispose that object of using block and free up memory. Its purpose is to free up the resources that we used inside the Using statement.
You can refer the following tutorial about how to connect to Oracle from C#. Then, make a test on your side.
Connecting to Oracle from C# / Winforms / Asp.net without tnsnames.ora: