Skip to main content

Pull method in RDA

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [eMbedded Visual Tools] >> SQL Server for CE Forum >> Pull method in RDA Page: [1]
Login
Message << Older Topic   Newer Topic >>
Pull method in RDA - 8/18/2004 11:53:10 AM   
nks

 

Posts: 8
Joined: 7/16/2004
Status: offline
Hi,
I have a question regarding Pull method. When i try to run the below code I have a problem.
I have two debugging statements before and after rda.Pull method as shown below

quote:

MessageBox.Show("Before pulling...")
rda.Pull("Employees", "Select * from Employees", rdaOleDbConnectString, RdaTrackOption.TrackingOnWithIndexes, "ErrorTable")
MsgBox("Pull Operation Completed", MsgBoxStyle.Information, "Pull")


Before Pulling statement is displayed but after that Iam getting a dialog box saying
SQL Server CE encountered problems in opening the SQL Server CE database

and it wont go further.

Does the Pull method in rda.Pull("Employees", "Select * from Employees", rdaOleDbConnectString, RdaTrackOption.TrackingOnWithIndexes, "ErrorTable")

creates table Employees automatically or do i need to create the table in program.

Kindly help me.

Thank You

P.S. Below is the code im using that i found at MSDN site



========================================
Private Sub btnPull_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPull.Click
Dim sqlEngine As SqlCeEngine
Dim conn As SqlCeConnection

If File.Exists("\My Documents\ssce.sdf") Then
File.Delete("\My Documents\ssce.sdf")
End If
sqlEngine = New SqlCeEngine
sqlEngine.LocalConnectionString = "Data Source=\My Documents\ssce.sdf"
sqlEngine.CreateDatabase()
sqlEngine.Dispose()
MessageBox.Show("Database Created")

conn = New SqlCeConnection("Data Source=\My Documents\ssce.sdf")
conn.Open()
MessageBox.Show("Connected...")


Dim rdaOleDbConnectString As String = "Provider=sqloledb; Data Source=NARESH;Initial Catalog=NorthWind;"
Dim rda As SqlCeRemoteDataAccess = Nothing
Try
rda = New SqlCeRemoteDataAccess
rda.InternetLogin = String.Empty
rda.InternetPassword = String.Empty
rda.InternetUrl = "http://<IP ADDRESS>/SQLCE/sscesa20.dll"
rda.LocalConnectionString = "Provider=Micrsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\My Documents\ssce.sdf"
MessageBox.Show("Before pulling...")
rda.Pull("Employees", "Select * from Employees", rdaOleDbConnectString, RdaTrackOption.TrackingOnWithIndexes, "ErrorTable")
MsgBox("Pull Operation Completed", MsgBoxStyle.Information, "Pull")
Catch ex As SqlCeException
MessageBox.Show(ex.Message)
Finally
rda.Dispose()
End Try
End Sub
=======================================

< Message edited by nks -- 8/18/2004 11:55:07 AM >
Post #: 1
RE: Pull method in RDA - 8/19/2004 12:30:14 AM   
ralphie

 

Posts: 29
Joined: 1/13/2004
From: Sydney, Australia
Status: offline
nks,

the tables are created automatically.

it appears you have a problem creating the database, this seems to be a reoccuring problem with the emulator your using since you've posted before about not being able to create databases. see other posts for answers.

regards,
ralph

(in reply to nks)
Post #: 2
RE: Pull method in RDA - 9/5/2004 3:11:19 PM   
quinncd


Posts: 2
Joined: 9/4/2004
Status: offline
I have a problem related to the pull method: It seems that when the connection is lost (ie. network is down, device is outside of the network, etc.) in the midst of a pull, the application freezes. The only way to recover is to manually kill it. I've tried to "catch" an error, but to no avail. Is there any way to capture this event (a lost connection while creating and populating a table through the pull method) and exit the application gracefully? I'm sure people have or will run into this situation, but I have not found any references that address this problem. Thanks.

(in reply to nks)
Post #: 3
RE: Pull method in RDA - 9/14/2004 9:36:44 AM   
quinncd


Posts: 2
Joined: 9/4/2004
Status: offline
I found the background behind this behavior:
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q285/8/65.asp?id=285865&SD=MSKB&NoWebContent=1
Apparently, rda continues to try to establish the connection for 5 minutes after the disruption of the pull method, due to a connection not being available. After this period, the application is basically useless and you have to manually kill the program through the running programs window. I've tried to address this by spawning the rda process in a separate thread, using OpenNETCF.Threading.ThreadEx method. When a connection is disrupted, I call the abort method. It works but it's not perfect.

(in reply to quinncd)
Post #: 4
Page:   [1]
All Forums >> [eMbedded Visual Tools] >> SQL Server for CE Forum >> Pull method in RDA Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.5.5 Unicode

0.000