0

When I try to populate a datatable of a Oracle table via .NET, I get error as

enter image description here

Here is the code that I used:

DataTable PRDTableResults = new DataTable();
using (OracleDataAdapter dataAdapter = new OracleDataAdapter())
{
  OracleCommand cmd = new OracleCommand("SELECT * from PRD");
  cmd.CommandType = CommandType.Text;
  cmd.Connection = conn;
  dataAdapter.SelectCommand = cmd;
  dataAdapter.Fill(PRDTableResults);
 }

I am not sure why such error showed up. The PRD table has fields with no precision and scale defined but as NUMBER.

enter image description here

1 Answer 1

1

I faced this error before and I remember that it was caused by a bug in the Oracle ODBC driver. I don't remember version exactly, I think it affected for 10.2 and 11.2 version, and only in x64 bit driver.

So you can try this, set platform target from AnyCPU to X86 in properties of your application project.

Sign up to request clarification or add additional context in comments.

1 Comment

Interesting! Thnx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.