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
ASP.Net Web Services uses open protocol SOAP (Simple Object Access
Protocol) can be developed with any of these two languages VB.Net or
C#.
You can use SQL CE as your local database store in PPC and pass a
dataset to the web service to update data to your SQL2k/Access
database.
dataset will be sent as XML file between PPC and Web Server.
If you are not going to use SQL Server CE. You can get a dataset from
web service that takes data from SQL2k/Accessdatabase, work with that
dataset
and sent it back to web service to update SQL2k/Access database.
It is not that easy to explain the whole process here.
Take a look here about web services
http://samples.gotdotnet.com/quickstart/aspplus/doc/webservicesintro.aspx
You may find one of Mr.Darren Shaffer's MSDN Webcasts valuable in
opting
the synchronization technique.
It explains you in detailed decision flowchart and a pros/cons matrix
comparing
merge, rda, and web services.
The webcast is available on-demand at:
Check out this thread too
http://groups.google.com/group/microsoft.public.sqlserver.ce/browse_thread/thread/1c57af3f86124dd9/8f098d0eb40c568c?q=synchronization+Arun+Darren&rnum=1#8f098d0eb40c568c
Listview sample
http://samples.gotdotnet.com/quickstart/CompactFramework/doc/listviewsort.aspx
These Links will always help you in Compact Framework development,
http://samples.gotdotnet.com/quickstart/CompactFramework/
http://www.codeproject.com/netcf/
http://www.businessanyplace.net/
http://smartdevices.microsoftdev.com/
Combo box code
System.Data.DataSet ds = new System.Data.DataSet();
System.Data.SqlClient.SqlDataAdapter da = new
System.Data.SqlClient.SqlDataAdapter(
"SELECT * FROM Stores ORDER BY
storeName", conn);
da.Fill(ds);
System.Data.DataTable dt = ds.Tables[0];
this.comboBox1.DataSource = dt;
this.comboBox1.DisplayMember = "storeName";
Sorry the code is in C#, you must have to specify DisplayMember
otherwise it will display "System.Data.DataRowView".
Hope this helps,
Cheers,
Arun.
IC Infotech
Thanks for your help with this. It looks like I will be doing a lot of
reading over the new couple weeks. I have ordered a couple books and will
definitely be checking out the links you provided. So far this, my first
foray into the compact framework and especially Dot Net has been more than
slightly frustrating with little progress to show for effort expended. I
hope to hit that first knowledge plateau soon, decreasing my frustration
level and gaining significant development progress. Thanks again for
donating your help and time. It is most appreciated . :-)
--
Ron W
www.WorksRite.com
"Arun" <arunkuma...@gmail.com> wrote in message
news:1127273871.6...@f14g2000cwb.googlegroups.com...