|
-
Jul 20th, 2005, 01:57 PM
#1
Thread Starter
Addicted Member
[RESOLVED] tutorial request
I need a tutorial on how to program for sql ce. i started this project awhile ago and had to hold it off until now. now i have forgotten what i was doing and had to start over. i have everything installed for ce. I have a database on the handheld created. now i just need to know how to get everythign syncronized. will it push when i sync? what kind of replication do i need to setup?
-
Jul 21st, 2005, 03:11 AM
#2
Fanatic Member
Re: tutorial request
For accessing remote sql server there are 2 options:
1. RDA(Remote Data Access)
2. Replication
RDA allows you to pull down data from sql server to the device. All you need to do on the device is create the database. the Pull method of RDA will copy the table and the indexes for that table and automatically recreate them on the device.
here is a example of rda
RDA
here is a tutorial on how to use replication
replication
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Jul 22nd, 2005, 08:33 AM
#3
Thread Starter
Addicted Member
Re: tutorial request
VB Code:
Private Sub sync()
Dim repl As SqlCeReplication = Nothing
Try
' Set the Replication object.
repl = New SqlCeReplication
repl.InternetUrl = "url"
repl.InternetLogin = "login"
repl.InternetPassword = "password"
repl.Publisher = "SQLSERV"
repl.PublisherDatabase = "receiving"
repl.PublisherLogin = "sa" 'a user to that database?
repl.PublisherPassword = "password"
repl.Publication = "receivingPUB" 'name of publication?
repl.SubscriberConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\my documents\receiving.sdf" 'location of databse on pocket pc?
repl.Subscriber = "*" 'i have no idea what to put here
' Create the Local SSCE Database subscription.
repl.AddSubscription(AddOption.CreateDatabase)
' Synchronize to the instance of SQL Server 2000 to populate the Subscription.
repl.Synchronize()
Catch err As SqlCeException
' Use your own error handling routine to show error information.
' ShowErrors(e)
Finally
' Dispose of the Replication object.
repl.Dispose()
End Try
End Sub
could someoen tell me i am doing wrong. it looks like I am missing the connection stuff like in normal windows apps? I had one and it gave me errors.
I dont understand the RDA link. it looked the same, but he had variables undeclared and i had no idea how to fix them. it looks like this pull subscription makes the connection all at once. I actually pull down the database. i know this because i deleted it and it created it in the right spot. the problem is that it only pulled a few sys tables.
-
Jul 22nd, 2005, 10:44 AM
#4
Thread Starter
Addicted Member
Re: tutorial request
i am totally redoing this code. it turns out my code isnt really the problem. it is my connection with the sql server. once i get the connection and the snapshot right, it should be fine. it is funny that this really isnt my fault, just the setup on the sql server.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|