database connectivity

  • Thread starter Thread starter Rami Saad
  • Start date Start date
R

Rami Saad

I faced a problem, I cannot add (by drag and drop) Connection and
DataAdapter objects from the tool box, why? And how can I use Ado.NET in
compact frame work?
It is known that we cannot use typed data sets in the compact frame work,
but what if I write the code that simulates a typed data set (by adding the
member variables for tables and so on), will it work? If it works then why
you cannot use directly the typed data sets?
 
Rami:

Using the SqlCe namespace and anything in System.Data for instance is
totally supported. Once you have a Database built on the device and your
replication set up you can just reference it directly.

To use it with the CF, simply declare an instance of a DataAdapter for
instance, provide its SELECT/UPDATE/DELETE logic , give the command a
connection/connection string and off you go. If you look at the Data
section on the quickstarts,
http://samples.gotdotnet.com/quickstart/compactframework/doc/default.aspx
there are some good exapmles.

you can also access your data via a web service just like you would in a
regular app.

And yes, you can specify your data type, column name etc for your
DataColumns in your table. Strongly typed datasets aren't supported, as
such, but that doesn't mean you shouldn't specify your types. However,
specifying the types of the columns != "Strongly Typed DataSet" even in the
full framework. You still have to generate the things in the full
framework. Remember that the compact framework is compact and in order to
keep it compact, everything that' s in the full framework can't be included.
This is evident in trying to create Design time support for custom controls.

The bottom line is that it takes a little more work to get some things done,
but you can almost always get what you need.

HTH,

Bill
 
Back
Top