Returning Long Datatype from Oracle database in .Net

K

Katie

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
 
T

tojo

k.mccowen@link- said:
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.

-- Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top