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