dbTalk Databases Forums  

Problems obtaining column length data from ADO.Net

comp.databases.rdb comp.databases.rdb


Discuss Problems obtaining column length data from ADO.Net in the comp.databases.rdb forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bob Jarvis
 
Posts: n/a

Default Problems obtaining column length data from ADO.Net - 01-25-2006 , 08:29 AM






We have a .NET web app which has been working well using a 2.0 version
of the Oracle Rdb ODBC driver. Management has decreed that we must use
the latest 3.0 Oracle Rdb ODBC driver (v3.01.00.02) on a new server.
Here's a code example of what we're doing:

Private pCnn As New OdbcConnection
Dim Ds As DataSet = New DataSet
Dim Da As New OdbcDataAdapter("SELECT * FROM " & TableName, pCnn)

Da.FillSchema(Ds, SchemaType.Mapped, TableName)

Under the 2.0 driver we find that after the FillSchema call all
attributes for columns in the DataSet are properly filled in and we go
on our merry way. When using the 3.0 driver, however, we find that
after FillSchema is called the MaxLength property on all columns in the
DataSet are not set (all are zeroed out), and thus when we try to
assign string values to various columns we get an error saying
something like "Cannot assign XXXXXXXXXXXX to column COLUMN_NAME
because the new value exceeds the maximum length". We thought about
setting the MaxLength property ourselves but found that it is not a
settable property.

We've traced ODBC activity and have found a couple of failures when
ADO.Net is calling SQLColAttribute for attributes 1211 and 1212. I've
found no documentation for what these attribute descriptor numbers
might be, and the values for SQL_DESC_* in SQL.H don't seem to be in
that range.

My questions:
1. Has anyone else encountered this problem? (Surely we're not the
first!)
2. Workaround? Fix?
3. Is this an MS problem or an Oracle problem?
4. Is there a newer version of the Oracle Rdb ODBC driver?

Any help or advice appreciated.


Reply With Quote
  #2  
Old   
Norman Lastovica
 
Posts: n/a

Default Re: Problems obtaining column length data from ADO.Net - 01-26-2006 , 01:29 PM






you best bet here would probably to start with
calling Rdb support directly.

Bob Jarvis wrote:
Quote:
We have a .NET web app which has been working well using a 2.0 version
of the Oracle Rdb ODBC driver. Management has decreed that we must use
the latest 3.0 Oracle Rdb ODBC driver (v3.01.00.02) on a new server.
Here's a code example of what we're doing:

Private pCnn As New OdbcConnection
Dim Ds As DataSet = New DataSet
Dim Da As New OdbcDataAdapter("SELECT * FROM " & TableName, pCnn)

Da.FillSchema(Ds, SchemaType.Mapped, TableName)

Under the 2.0 driver we find that after the FillSchema call all
attributes for columns in the DataSet are properly filled in and we go
on our merry way. When using the 3.0 driver, however, we find that
after FillSchema is called the MaxLength property on all columns in the
DataSet are not set (all are zeroed out), and thus when we try to
assign string values to various columns we get an error saying
something like "Cannot assign XXXXXXXXXXXX to column COLUMN_NAME
because the new value exceeds the maximum length". We thought about
setting the MaxLength property ourselves but found that it is not a
settable property.

We've traced ODBC activity and have found a couple of failures when
ADO.Net is calling SQLColAttribute for attributes 1211 and 1212. I've
found no documentation for what these attribute descriptor numbers
might be, and the values for SQL_DESC_* in SQL.H don't seem to be in
that range.

My questions:
1. Has anyone else encountered this problem? (Surely we're not the
first!)
2. Workaround? Fix?
3. Is this an MS problem or an Oracle problem?
4. Is there a newer version of the Oracle Rdb ODBC driver?

Any help or advice appreciated.
--
- - - - -
opinions expressed here are mine and mine alone
and certainly are not intended in any way to
express or represent any opinions or commitment
of oracle corporation.

norman lastovica / oracle rdb engineering


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.