Pull method in RDA (Full Version)

All Forums >> [eMbedded Visual Tools] >> SQL Server for CE Forum



Message


nks -> Pull method in RDA (8/18/2004 11:53:10 AM)

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
=======================================




ralphie -> RE: Pull method in RDA (8/19/2004 12:30:14 AM)

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




quinncd -> RE: Pull method in RDA (9/5/2004 3:11:19 PM)

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.




quinncd -> RE: Pull method in RDA (9/14/2004 9:36:44 AM)

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.




Page: [1]



Forum Software © ASPPlayground.NET Advanced Edition 2.5.5 Unicode

0.016