nshroff

nshroff

  • NA
  • 2
  • 0

Problem with Pull method

Oct 14 2004 1:46 PM
Hi, I am trying to develop a pocket PC application using VB.NET, SQL Server CE and SQL Server 2000. I am trying to pull customers table from Northwind to my pocket pc. but am getting an error saying SQL Server CE encountered a problem in opening SQL server ce database. I couldnt able to fix that problem. Can anyone help me out. Here is the code that iam using. ---------------------------------------------------------- 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 Not File.Exists("\My Documents\local1.sdf") Then sqlEngine = New SqlCeEngine sqlEngine.LocalConnectionString = "Data Source=\My Documents\local1.sdf" sqlEngine.CreateDatabase() sqlEngine.Dispose() MessageBox.Show("Database Created") Else conn = New SqlCeConnection("Data Source=\My Documents\local1.sdf") conn.Open() MessageBox.Show("Connected...") End If Dim rdaOleDbConnectString As String = "Provider=sqloledb; Data Source=myserver;Initial Catalog=Northwind" Dim rda As SqlCeRemoteDataAccess = Nothing Try rda = New SqlCeRemoteDataAccess rda.InternetLogin = String.Empty rda.InternetPassword = String.Empty rda.InternetUrl = "http://myip/SQLCE/sscesa20.dll" rda.LocalConnectionString = "Provider=Micrsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\My Documents\local1.sdf" MessageBox.Show("Before pulling...") rda.Pull("Customers", "Select * from Customers", 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 ------------------------------------------------- i believe SQL server CE configuration is working as i can see the SQL server CE message when i open that virtual directory path. Please someone help me. Thanks in advance

Answers (1)