SQL Database Connection

K

Kev Westwood

Hi

I am developing an application for Windows CE v5 on a device with a wireless
adapter connected to a LAN. I am trying to decide which is the best method
of connecting my application to a SQL server database.

I have already successfully connected using sqlclient.slqconnection so can
read and write data etc via this method.

I have also tried creating a web service. So i can use the methods of the
web service to read and write data to the database.

Boths these approaches work fine so im trying to work out the pros and cons
of each. Any comments/suggestions would be much appriciated.

Thanks
Kevin
 
C

Christian Resma Helle

Hi Kev,

I would suggest that you have a local database on the device so when
you make SELECT's you don't have to go through the network. You can
populate your local database by using merge replication or getting
data collections back from a web service.

I think that you should also consider that your application will run
in an occasionally connected environment. You can easily create an
offline or disconnected agent using the Windows Mobile 5.0 (or 6)
State and Notification API "OR" you can use the Disconnected Services
Agent included in the Mobile Client Software Factory by the Microsoft
Patterns and Practices group.

Here's a link for the Mobile Client Software Factory - July 2006. It
includes links to other useful information at the bottom of the page
http://msdn2.microsoft.com/en-us/library/aa480471.aspx

You can downloaded for free at:
http://www.microsoft.com/downloads/...08-9f57-4c0f-97fb-f9c65a9bbf22&displaylang=en
 
K

Kev Westwood

Thanks Christian

My application will run in a connected environment and will need to select
from tables containing 100,000+ rows. Is it practical to bring this data to
a local database? Many of these rows will be updated by a backoffice system
on a regular basis.
 
G

Guest

Not really. 100,000 rows will take forever to write to a local database and
you'll probebly find fetching data from the database rather sluggish.

The question of what approach to use depends on your architecture. Using
SqlClient allows no layering - so making it more difficult to cange code in
the future. Whereas the Web Service does. I'd use a Web Service over direct
comms.
 
K

Kev Westwood

Are you saying that by having the business logic within the webservice layer
will allow for changes to be made more easily than if it was in the device
application? I guess any changes would have to be installed on every device
rather than in just one place (the website).
 
G

Guest

Yes it makes your app more scalable to have business rules on a server -
which is where it should be - generally, you will have less servers than
devices. In terms of updating in one place depends again on your architecture.
 
C

Christian Resma Helle

I completely agree with Simon on using web services, it would be the
smart thing to do with a database that big.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top