P
Poohface
I'm having an issue pulling from a SQL server to my compact app. My
code is as follows:
//////////////////////
Inherits System.Windows.Forms.Form
Friend WithEvents Calllist As System.Windows.Forms.ListBox
Friend WithEvents btRefresh As System.Windows.Forms.Button
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
'Local ConString
Private strConLocal As String =
"Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\My
Documents\accu.sdf"
'Remote ConString
Private strConRemote As String = "provider=sqloledb;user
id=(REMOVED);password=(REMOVED);data source=(REMOVED);initial
catalog=(REMOVED);persist security info=True"
'URL String for SQLce connection
Private strURL As String =
"http://(REMOVED)/(REMOVED)/sscesa20.dll"
Private Sub btRefresh_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btRefresh.Click
Try
Dim rdaAccu As New SqlServerCe.SqlCeRemoteDataAccess
rdaAccu.LocalConnectionString = strConLocal
rdaAccu.InternetUrl = strURL
rdaAccu.Pull("Cust", "Select Name from Customer Where
StatusID = 1", strConRemote)
rdaAccu.Dispose()
Catch exsql As SqlServerCe.SqlCeException
Dim strError As String
strError = exsql.NativeError.ToString
MsgBox(strError & " - " & exsql.Message.ToString,
MsgBoxStyle.Exclamation, "POOF!")
Debug.WriteLine(strError & " - " & exsql.Message.ToString)
End Try
End Sub
/////////////////////////
The error I'm getting is:
28567 - The table cannot be opened [,,,Table name,,]
What I've checked so far.
I've made the accu.sdf DB via the SQLCEQuery tool, just a plain DB
with a name, no password or encryption. No tables are currently in it.
So the table "Cust" that I want to pull to does not exist already as
per the pull methods documentation.
(localTableName
The name of the SQL Server CE table that will receive the extracted
SQL Server records. An error occurs if the table already exists. )
I'm confidant in my connection to the db as far as connection strings
and I'm able to browse to the DLL and get the expected response from
the server. I'm not sure where I've gone wrong. Any help would be
great.
Thanks,
Norst
code is as follows:
//////////////////////
Inherits System.Windows.Forms.Form
Friend WithEvents Calllist As System.Windows.Forms.ListBox
Friend WithEvents btRefresh As System.Windows.Forms.Button
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
'Local ConString
Private strConLocal As String =
"Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\My
Documents\accu.sdf"
'Remote ConString
Private strConRemote As String = "provider=sqloledb;user
id=(REMOVED);password=(REMOVED);data source=(REMOVED);initial
catalog=(REMOVED);persist security info=True"
'URL String for SQLce connection
Private strURL As String =
"http://(REMOVED)/(REMOVED)/sscesa20.dll"
Private Sub btRefresh_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btRefresh.Click
Try
Dim rdaAccu As New SqlServerCe.SqlCeRemoteDataAccess
rdaAccu.LocalConnectionString = strConLocal
rdaAccu.InternetUrl = strURL
rdaAccu.Pull("Cust", "Select Name from Customer Where
StatusID = 1", strConRemote)
rdaAccu.Dispose()
Catch exsql As SqlServerCe.SqlCeException
Dim strError As String
strError = exsql.NativeError.ToString
MsgBox(strError & " - " & exsql.Message.ToString,
MsgBoxStyle.Exclamation, "POOF!")
Debug.WriteLine(strError & " - " & exsql.Message.ToString)
End Try
End Sub
/////////////////////////
The error I'm getting is:
28567 - The table cannot be opened [,,,Table name,,]
What I've checked so far.
I've made the accu.sdf DB via the SQLCEQuery tool, just a plain DB
with a name, no password or encryption. No tables are currently in it.
So the table "Cust" that I want to pull to does not exist already as
per the pull methods documentation.
(localTableName
The name of the SQL Server CE table that will receive the extracted
SQL Server records. An error occurs if the table already exists. )
I'm confidant in my connection to the db as far as connection strings
and I'm able to browse to the DLL and get the expected response from
the server. I'm not sure where I've gone wrong. Any help would be
great.
Thanks,
Norst