Hello Everyone,
I am using VS2k3 on WInXP running IIS 5.1. I am trying to use RemoteDataAccess to pull data from SQL Server 2000 onto HP ipaq running SQL Server CE 2.0 and pocket PC 2002. The Pull method is giving me following error:
the request to send data to the computer running IIS has failed. for more information see HRESULT.
The code for the PULL is:
Private Sub btnPull_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPull.Click
Dim cn As SqlCeConnection
Dim rda As SqlCeRemoteDataAccess
Dim sqlEngine As SqlCeEngine
Try
btnPull.Enabled = False
'Create the database if it does not exist
If (Not (File.Exists("\My Documents\IntelligenceData
.sdf"))) Then
sqlEngine = New SqlCeEngine
sqlEngine.LocalConnectionS
tring = "Data Source=\My Documents\IntelligenceData
.sdf; Password=smarthouse; Encrypt Database=True"
sqlEngine.CreateDatabase()
sqlEngine.Dispose()
Else
'Open the connection to the database
cn = New SqlCeConnection("Data Source=\My Documents\IntelligenceData
.sdf; Password=smarthouse")
cn.Open()
Dim cmd As SqlCeCommand = cn.CreateCommand()
'Drop the FieldMemos table
cmd.CommandText = "DROP TABLE FieldMemos"
cmd.ExecuteNonQuery()
'close the connection
If cn.State <> ConnectionState.Connecting
Then
cn.Close()
End If
End If
'Instantiate the RDA object
rda = New SqlCeRemoteDataAccess
'Create the connection string for connecting to
'the SQL server
Dim remoteConnectionString As String = "Provider=SQLOLEDB; " & _
"Data Source= Hemal_Laptop; " & _
"Initial Catalog=IntelligenceData; " & _
"User Id=sa; " & _
"Password=smarthouse"
rda.InternetLogin = "Administrator"
rda.InternetPassword = "password"
rda.InternetUrl = "
https://hemal_laptop/fieldagentrda/sscesa20.dll"
rda.LocalConnectionString = "Data Source=\My Documents\IntelligenceData
.sdf; SSCE:Database Password=smarthouse"
rda.Pull("FieldMemos", "Select * From FieldMemos", remoteConnectionString, RdaTrackOption.TrackingOnW
ithIndexes
, "FieldMemosErrorTable")
Catch sqlEx As SqlCeException
Dim sqlError As SqlCeError
For Each sqlError In sqlEx.Errors
MessageBox.Show(sqlError.M
essage)
Next
Catch ex As Exception
MessageBox.Show(ex.Message
)
Finally
rda.Dispose()
btnPull.Enabled = True
End Try
End Sub
If anyone knows the cause of this error please let me know ASAP. I have checked a lot of other posts on a lot of websites but havent arrived at any solution yet.
Thanks,
Hemal Modi