Hi everybody,


Does anybody know if it is possible to convert an
Oracle Data Reader into a SQL Server Data Reader.
I unsucessfully tried using the Ctype function.
My problem is that I am developing a system that
should work with both SQL Server 2000 and Oracle 9i.
So I would like to use the same classes and methods to
access both databases.
Does anyone did it before?


Thanks a lot,


Amintas

Re: Converting an Oracle Data Reader into a SQL Server Data Reader by Frans

Frans
Sat Dec 20 08:34:42 CST 2003

<anonymous@discussions.microsoft.com> wrote in news:080f01c3c6fe$fd5980c0
$a101280a@phx.gbl:

> Hi everybody,
>
>
> Does anybody know if it is possible to convert an
> Oracle Data Reader into a SQL Server Data Reader.
> I unsucessfully tried using the Ctype function.
> My problem is that I am developing a system that
> should work with both SQL Server 2000 and Oracle 9i.
> So I would like to use the same classes and methods to
> access both databases.
> Does anyone did it before?
>
Your code that should work with both databases should use IDataReader
types, like (using VB, since you mention CType)

' Create a datareader for the current database, can be oracle or sqlserver
Dim myDataReader As IDataReader = CreateDataReader()
' now work with the myDataReader as you do now, it should work.

Frans

--
Get LLBLGen Pro, the new O/R mapper for .NET: http://www.llblgen.com

Re: Converting an Oracle Data Reader into a SQL Server Data Reader by Miha

Miha
Sat Dec 20 10:28:45 CST 2003

Hi,

In addition to Frans.
IOW Frans is talking about factory pattern - where you use interfaces
instead of specialized classed.
The other way would be to use OleDb namespace (with some speed cost).

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com

<anonymous@discussions.microsoft.com> wrote in message
news:080f01c3c6fe$fd5980c0$a101280a@phx.gbl...
> Hi everybody,
>
>
> Does anybody know if it is possible to convert an
> Oracle Data Reader into a SQL Server Data Reader.
> I unsucessfully tried using the Ctype function.
> My problem is that I am developing a system that
> should work with both SQL Server 2000 and Oracle 9i.
> So I would like to use the same classes and methods to
> access both databases.
> Does anyone did it before?
>
>
> Thanks a lot,
>
>
> Amintas
>



Converting an Oracle Data Reader into a SQL Server Data Reader by Amintas

Amintas
Sat Dec 20 11:21:30 CST 2003

Hi Frans and Miha,


Thank you very much for your support.
I have tried the interface approach proposed by Frans.
I worked beautifully!
That's exactly what I was looking for since I will have
better performance.
Thanks again!


Cheers,



Amintas

>-----Original Message-----
>Hi everybody,
>
>
> Does anybody know if it is possible to convert an
>Oracle Data Reader into a SQL Server Data Reader.
> I unsucessfully tried using the Ctype function.
> My problem is that I am developing a system that
>should work with both SQL Server 2000 and Oracle 9i.
> So I would like to use the same classes and methods
to
>access both databases.
> Does anyone did it before?
>
>
> Thanks a lot,
>
>
> Amintas
>
>.
>