Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Returning Long Datatype from Oracle database in .Net

Re: Returning Long Datatype from Oracle database in .Net

From: tojo <Tojo_at_hotmail.com>
Date: Mon, 15 Mar 2004 18:05:08 +0100
Message-ID: <MPG.1ac000b1c0caa8199896e0@news.t-online.de>


In article <10517eva353j103_at_corp.supernews.com>, k.mccowen_at_link- hrsystems.com says...
> Hi all
> I am trying to return a field which is of long datatype from an Oracle 9i
> database. I am accessing the database with ODP.NET, but the only thing being
> returned is an empty string.
> Here is an example of the code I am using:
>
> string strSQL = "SELECT <Long field> from <Table>";
> OracleConnection strConnection = new OracleConnection(
> "Data Source=<datasource>;" +
> "User Id=<user>;" +
> "Password=<password>;");
> strConnection.Open();
> DataSet objDataSet = new DataSet();
> OracleDataAdapter objDataAdapter = new OracleDataAdapter(strSQL,
> strConnection); objDataAdapter.Fill(objDataSet, "Table"); DataView
> objDataView = new DataView(objDataSet.Tables["Table"]);
> dgUsers.DataSource = objDataView;
> dgUsers.DataBind();
> strConnection.Close();
>
> Any help with this would be appreciated
> Thanks
> Katie
>
>
>

You may have to use an OracleCommand object with your adapter. Then set the InitialLongFetchSize property on your OracleCommand to a non-zero value, otherwise the long column won't be fetched.

Received on Mon Mar 15 2004 - 11:05:08 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US