Results 1 to 5 of 5

Thread: Karahim...can u send...

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    6

    Karahim...can u send...

    Hai Karahim,

    Can u send working code of RDA Pull method....with example.....

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

    Re: Karahim...can u send...

    VB Code:
    1. Private m_cn As SqlCeConnection
    2.     Private m_rda As SqlCeRemoteDataAccess
    3.  
    4.     Private m_localDB As String = "\My Documents\memodb.sdf"
    5.     Private m_localConn As String = "Data Source=" & m_localDB & ";" & _
    6.                                     "Password=pwd;" & _
    7.                                     "Encrypt Database=False"
    8.  
    9.     Private m_remoteConn As String = "Provider=SQLOLEDB;" & _
    10.                                      "Data Source=xxx.xxx.xxx.xxx;" & _
    11.                                      "Initial Catalog=RDAdata;" & _
    12.                                      "User ID=sa;" & _
    13.                                      "Password="
    14.  
    15.     Private Sub btPull_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btPull.Click
    16.         Try
    17.             btPull.Enabled = False
    18.  
    19.             If Not File.Exists(m_localDB) Then
    20.                 Dim l_sqlEngine As New SqlCeEngine
    21.                 l_sqlEngine.LocalConnectionString = m_localConn
    22.  
    23.                 l_sqlEngine.CreateDatabase()
    24.                 l_sqlEngine.Dispose()
    25.             Else
    26.                 If m_cn Is Nothing Then
    27.                     m_cn = New SqlCeConnection(m_localConn)
    28.                     m_cn.Open()
    29.                 End If
    30.  
    31.                 Dim l_cmd As SqlCeCommand = m_cn.CreateCommand
    32.  
    33.                 l_cmd.CommandText = "DROP TABLE FieldMemos"
    34.                 l_cmd.ExecuteNonQuery()
    35.  
    36.                 If m_cn.State = ConnectionState.Open Then
    37.                     m_cn.Close()
    38.                 End If
    39.             End If
    40.  
    41.             m_rda = New SqlCeRemoteDataAccess
    42.  
    43.             m_rda.InternetLogin = "<MYDOMAIN>\RDAuser"
    44.             m_rda.InternetPassword = "rda"
    45.             m_rda.InternetUrl = "http://xxx.xxx.xxx.xxx/MyRDA/sscesa20.dll"
    46.             m_rda.LocalConnectionString = m_localConn
    47.  
    48.             m_rda.Pull("FieldMemos", "SELECT * FROM FieldMemos", m_remoteConn, RdaTrackOption.TrackingOnWithIndexes, "FieldMemosErrorTable")
    49.  
    50.             PopulateDataGrid()
    51.         Catch ex As SqlCeException
    52.             Dim l_sqlerr As SqlCeError
    53.             For Each l_sqlerr In ex.Errors
    54.                 MsgBox(l_sqlerr.Message)
    55.             Next
    56.         Catch ex As Exception
    57.             MsgBox(ex.Message)
    58.         Finally
    59.             m_rda.Dispose()
    60.             btPull.Enabled = True
    61.         End Try
    62.     End Sub
    63.  
    64.  
    65.     Private Sub PopulateDataGrid()
    66.         Try
    67.             If m_cn.State <> ConnectionState.Open Then
    68.                 m_cn.Open()
    69.             End If
    70.  
    71.             Dim l_cmd As SqlCeCommand = m_cn.CreateCommand
    72.             l_cmd.CommandText = "SELECT * FROM FieldMemos"
    73.             l_cmd.CommandType = CommandType.Text
    74.  
    75.             Dim l_da As SqlCeDataAdapter
    76.             l_da = New SqlCeDataAdapter(l_cmd)
    77.  
    78.             Dim l_ds As New DataSet
    79.             l_da.Fill(l_ds)
    80.  
    81.             DataGrid1.DataSource = l_ds.Tables(0)
    82.         Catch ex As SqlCeException
    83.             Dim l_sqlerr As SqlCeError
    84.             For Each l_sqlerr In ex.Errors
    85.                 MsgBox(l_sqlerr.Message)
    86.             Next
    87.         Catch ex As Exception
    88.             MsgBox(ex.Message)
    89.         End Try
    90.     End Sub
    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: Karahim...can u send...

    Hello,

    when i try u r code...there was a error....

    error is follows:

    A Request to send data to the computer running IIS has failed .For more information see HRESULT[,,,]

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

    Re: Karahim...can u send...

    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
    Lively Member
    Join Date
    Feb 2005
    Posts
    79

    Re: Karahim...can u send...

    Hi Vendi Naren

    Sorry for the delayed reply, I was busy on my project and was away from the forum.
    Hope your issue is resolved by now, if not please inform so that I can post you my code.

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