Getting DataReader

  • Thread starter Thread starter info
  • Start date Start date
I

info

Hi

In an Application I've 3 problems I hope some one can give me a hint.

1. I've a webservice which generates an DataReader. How do I get this
DataReader back to the PocketPC ?

2. The Webservice could generate an OleDBDataReader or an
SQLDbDataReader so I thought about giving back IDbDataReader or the
common Baseclass. But they don't support serializeable. How may I solve
this?

3. I thoughjt about creating a custom serializable object and returning
it to the client but thre no methods are know. Invoking methods via
Reflections faile with an unsupported exception.
Do I have to set any attributes to custom classes?


Hope someone can give me any hints on how to get an DataReader ( and in
second step OleDb or SQL) to the pocket PC


Many Thanks in advance!
 
You can't - DataReader only makes sense on a system it was created on. It
contains no data and needs database for data access.

You need to load data from that DataReader into some buffer (e.g. DataSet)
and send that buffer instead.

Or, open DataReader on device if there's provider for your database.

SqlDataReader is supported on NETCF, I suspect that's what you mean by
"SQLDbDataReader"


--
Best regards,


Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
Ilya already answered the question but let me chime in on one thing. A
DataReader is a 'connected' object meaning that it only works with an open
and available connection to a database. Since connections aren't
serializable, then there's no way using the WS methodology to use one.
Also, DataReaders are usedunder the hood to populate datasets when you use a
DataAdapter.Fill command, so you can do the same. A DataTable, DataSet
should solve this whole problem.

Cheers,

Bill
 
Back
Top