[CODE]
Private Sub pulllikehell()
Dim cn As SqlCeConnection
Dim rda As SqlCeRemoteDataAccess = Nothing
Dim sqlEngine As SqlCeEngine
Try
' Create database if it doesn't already exist
If (Not File.Exists("\My Documents\ORDER.sdf")) Then
sqlEngine = New SqlCeEngine
sqlEngine.LocalConnectionString = "Data Source=\My Documents\ORDER.sdf;"
sqlEngine.CreateDatabase()
sqlEngine.Dispose()
Else
' Open the connection to the database
cn = New SqlCeConnection("Data Source=\My Documents" & _
"\ORDER.sdf:")
cn.Open()
Dim cmd As SqlCeCommand = cn.CreateCommand()
' Drop the FieldMemos table
cmd.CommandText = "DROP TABLE STAFF"
cmd.ExecuteNonQuery()
' Close the connection
End If
' Instantiate the RDA Object
rda = New SqlCeRemoteDataAccess
' Connection String to the SQL Server.
Dim remoteConnectString As String = "Provider=SQLOLEDB;" & _
"Data Source=KANGALERT/SQLEXPRESS;" & _
"Initial Catalog=ORDER;"
rda.InternetLogin = ""
rda.InternetPassword = ""
rda.InternetUrl = "http://kangalert/server/sqlcesa30.dll"
rda.LocalConnectionString = "Data Source=\My Documents\" & _
"ORDER.sdf;"
rda.Pull("STAFF", "Select * from STAFF", remoteConnectString, _
RdaTrackOption.TrackingOnWithIndexes)
MsgBox("ok")
Catch sqlex As SqlCeException
Dim sqlError As SqlCeError
For Each sqlError In sqlex.Errors
MessageBox.Show(sqlError.Message)
Next
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
rda.Dispose()
End Try
End Sub
[/CODE]
computer server name is kangalert
and got 2 sqlservice run in my pc, SQLEXPRESS and MSSQLSERVER
DATABASE NAME IS ORDER with a TABLE call STAFF
when come to this statement
rda.LocalConnectionString = "Data Source=\My Documents\ORDER.sdf"
ERROR MESSAGE: A request to send data to the computer running IIS has failed. For more information, see HRESULT.
when come to this statement
rda.Pull("STAFF", "Select * from STAFF", remoteConnectString, _
RdaTrackOption.TrackingOnWithIndexes)
ERROR MESSAGE :A required property is not specified. [ Property name = SubscriberConnectionString ]
HOPEFULLY ANYONE CAN HELP ME SOLVE IT. THANKS IN ADVANCE
its a similar problem on the other thread... have you debugged your codes? if u already did, can you be more specific on the location of the problem...|||ERROR: A request to send data to the computer running IIS has failed
This occurs when the Client Agent box (Emulator or Device) does not have the network connectivity with IIS Box. Make sure you have the connectivity. Try browsing the above sqlcesa30.dll URL in your emulator/device IE, to ensure the connectivity.
ERROR: A required property is not specified. [ Property name = SubscriberConnectionString ]
I really do not understand how you have got this error.
Let us know the results after resolving the first error.
Thanks,
Laxmi Narsimha Rao ORUGANTI, MSFT, SQL Mobile, Microsoft Corporation
没有评论:
发表评论