Results 1 to 6 of 6

Thread: Problem In PULL method...

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    6

    Problem In PULL method...

    hi frnds,


    iam trying to get data from sql server to sql server ce.....but it is generating error......


    plz refer my code and suggest some changes.......my code follows


    If File.Exists("\Temp\naren.sdf") Then
    File.Delete("\Temp\naren.sdf")
    End If


    Dim objsqlengine As New SqlCeEngine("Data Source=\Temp\naren.sdf")
    objsqlengine.CreateDatabase()


    Dim rdaOleDbConnectString As String = "Initial Catalog=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=MobileData;Packet Size=4096;Workstation ID=SOFT;"

    Dim rda As New SqlCeRemoteDataAccess


    rda.InternetUrl = "http://localhost/SQLCE/Sscesa20.dll"
    rda.LocalConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\Temp\naren.sdf"


    rda.Pull("student", "Select * from student", rdaOleDbConnectString, RdaBatchOption.BatchingOn)
    MsgBox("Pull operation completed", MsgBoxStyle.Information, "Pull")

  2. #2
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: Problem In PULL method...

    what is the error????? There are many different errors that can occur during RDA!!!!

    did you have a look at this post http://www.vbforums.com/showthread.php?t=364268
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    6

    Re: Problem In PULL method...

    hai strider,

    My Error is Follows

    An unhandled exception of type 'System.Data.SqlServerCe.SqlCeException' occurred in System.Data.SqlServerCe.dll

    Additional information: SqlCeException

  4. #4
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: Problem In PULL method...

    add a try catch around the code

    try

    catch ex As sqlceexception
    msgbox ex.message
    end try

    is sqlce installed on the handheld?
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    6

    Re: Problem In PULL method...

    i tried by putting try block....but is of no use....same eror coming...


    here iam listing code below


    If File.Exists("\Temp\naren.sdf") Then
    File.Delete("\Temp\naren.sdf")
    End If

    Try

    Dim objsqlengine As New SqlCeEngine("Data Source=\Temp\naren.sdf")
    objsqlengine.CreateDatabase()


    Dim rdaOleDbConnectString As String = "Initial Catalog=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=MobileData;Packet Size=4096;Workstation ID=SOFT;"
    'Dim rdaOleDbConnectString As String = "Provider=sqloledb;DataSource=SOFT;InitialCatalog=MobileData;UserId=sa;Password ="


    Dim rda As New SqlCeRemoteDataAccess



    rda.InternetUrl = "http://localhost/SQLCE/Sscesa20.dll"
    rda.LocalConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\Temp\naren.sdf"


    rda.Pull("student", "Select * from student", rdaOleDbConnectString, RdaBatchOption.BatchingOn)
    MsgBox("Pull operation completed", MsgBoxStyle.Information, "Pull")
    Catch ex As Exception

    MsgBox(ex.Message.ToString)
    End Try

  6. #6
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: Problem In PULL method...

    Hi,
    single step through, and see where it hits an error

    Pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width