tools for synchronizing SqlCe to Sql2k or Access 2K on the desktop
- From: "Ron Weiner" <weinNoSpam1@xxxxxxxxxxxxxx>
- Date: Tue, 20 Sep 2005 13:49:02 -0400
I am brand new to both the Pocket PC compact framework and Dot Net. I have
extensive experience creating applications in the VB and MS Access worlds.
I now find myself committed to writing a small pocket pc application that
needs to have good database access.
Based on what I have found so far it looks like SqlCe is probably the
correct database container in this environment and I am not opposed to using
it, but to date I have not seen any canned clean way of synchronizing the
desktop either Sql 2K or preferably Access 2K and the device. Can someone
point me in the right direction?
I have also been messing around with SqlCe and trying to populate some List
and Combo boxes. In the old (classic) VB world it is pretty straight
forward to iterate through a recordset adding the text items to the list
box and then setting the ItemData property to the Pkey the for that item.
It is even easier in access where they support multiple columns some of
which can be hidden, and the combo has a RecordSource property that can be
set directly to a Sql statement. To this point I have been completely
unsuccessful in performing this simple feat using VB.net. Here is what I am
currently doing which actually works but is Ugly a sin.
conn.Open()
Dim reader As SqlCeDataReader
Dim cmd As New SqlCeCommand("SELECT * FROM Stores ORDER BY
storeName", conn)
reader = cmd.ExecuteReader
cboStoreID.ValueMember() = "storeID"
cboStoreID.DisplayMember() = "storeName"
While reader.Read
cboStoreID.Items.Add(reader.Item("StoreName") & "|" &
reader.Item("StoreID"))
End While
conn.Close()
Which Produces a list like this"
Some Store|1
Some other Store|2
I am able to parse it back out on the SelectedIndexChanged event doing a
Dim a() As String = cboStoreID.Text.Split("|") and using the a(1) array
element for the StoreID, but there is no way I can put this kind of dreck in
my delivered app.
I am obviously not in the Dot Net brain set yet. Can some kind soul provide
this frustrated Dot Net newbie with an example how this is done.
--
Ron W
www.WorksRite.com
.
- Follow-Ups:
- Prev by Date: Re: storing a DC
- Next by Date: Anybody knows this compilation error in pocket pc 2002?
- Previous by thread: ActiveX Control Creation and Web Based Implemenation
- Next by thread: Re: tools for synchronizing SqlCe to Sql2k or Access 2K on the desktop
- Index(es):
Relevant Pages
|