Datatables to portable!

  • Thread starter Thread starter tc
  • Start date Start date
T

tc

Hi.

I have a requirement to write a Windows Service that will sit on a host and
supply data to portable units on RF.

I want to write this in such a way that the service will connect to any ODBC
datasource, the portable will send SQL instructions via sockets to the
service. This I have no problem with.

I will have different routines for Insert, Update and Select in the host
service, also certain routines to return Sum and other Agregate information.

My issues are will returning the data to the portable. I can of course send
all the data I want back to the portable on the open socket, but it's how to
get that data back to the portable as a data table.

I could quite easily write a routine to take a text string and turn it into
a data table, but obviously this would take a lot of processing and time on
the portables.

Any ideas?

Thanks.
 
Interesting subject.

The .NET DataSet class does implement IXMLSerializable and ISerializable
interfaces which means you could serialize your dataset in order to send it
via sockets just simply convert the serialized dataset to a byte array using
something like: System.Text.Encoding.ASCII.GetBytes(string).

You can use WriteXML on the dataset object to write your dataset to a XML
file, there are many overloads for this method. See here for more
information: http://msdn2.microsoft.com/en-us/library/hb27k0tf.aspx

Just a couple of points, why are you using Sockets? why not a web service.
Generally Sockets are used for more lower level stuff. Over what connection
is this going to run? keep in mind that DataSets are very heavy many OO
purists will advise against passing DataSets between process boundaries.
 
Many thanks for the info, this should be enough to get me started.

The reason for sockets? Well...

I have had a couple of customers recently that have wanted an RF to portable
solution, but don't want to, or can't afford web services. One instance was
a customer wanting an RF connection to a stand alone PC, a single AP and
'this service' would have done the trick.

Another customer wanted a web based solution but wan't allowed to install
the required components!

UK customers can be difficult to please!

Cheers.
 
Back
Top