Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Returning Long Datatype from Oracle database in .Net
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.
![]() |
![]() |