Hai Karahim,
Can u send working code of RDA Pull method....with example.....
Printable View
Hai Karahim,
Can u send working code of RDA Pull method....with example.....
VB Code:
Private m_cn As SqlCeConnection Private m_rda As SqlCeRemoteDataAccess Private m_localDB As String = "\My Documents\memodb.sdf" Private m_localConn As String = "Data Source=" & m_localDB & ";" & _ "Password=pwd;" & _ "Encrypt Database=False" Private m_remoteConn As String = "Provider=SQLOLEDB;" & _ "Data Source=xxx.xxx.xxx.xxx;" & _ "Initial Catalog=RDAdata;" & _ "User ID=sa;" & _ "Password=" Private Sub btPull_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btPull.Click Try btPull.Enabled = False If Not File.Exists(m_localDB) Then Dim l_sqlEngine As New SqlCeEngine l_sqlEngine.LocalConnectionString = m_localConn l_sqlEngine.CreateDatabase() l_sqlEngine.Dispose() Else If m_cn Is Nothing Then m_cn = New SqlCeConnection(m_localConn) m_cn.Open() End If Dim l_cmd As SqlCeCommand = m_cn.CreateCommand l_cmd.CommandText = "DROP TABLE FieldMemos" l_cmd.ExecuteNonQuery() If m_cn.State = ConnectionState.Open Then m_cn.Close() End If End If m_rda = New SqlCeRemoteDataAccess m_rda.InternetLogin = "<MYDOMAIN>\RDAuser" m_rda.InternetPassword = "rda" m_rda.InternetUrl = "http://xxx.xxx.xxx.xxx/MyRDA/sscesa20.dll" m_rda.LocalConnectionString = m_localConn m_rda.Pull("FieldMemos", "SELECT * FROM FieldMemos", m_remoteConn, RdaTrackOption.TrackingOnWithIndexes, "FieldMemosErrorTable") PopulateDataGrid() Catch ex As SqlCeException Dim l_sqlerr As SqlCeError For Each l_sqlerr In ex.Errors MsgBox(l_sqlerr.Message) Next Catch ex As Exception MsgBox(ex.Message) Finally m_rda.Dispose() btPull.Enabled = True End Try End Sub Private Sub PopulateDataGrid() Try If m_cn.State <> ConnectionState.Open Then m_cn.Open() End If Dim l_cmd As SqlCeCommand = m_cn.CreateCommand l_cmd.CommandText = "SELECT * FROM FieldMemos" l_cmd.CommandType = CommandType.Text Dim l_da As SqlCeDataAdapter l_da = New SqlCeDataAdapter(l_cmd) Dim l_ds As New DataSet l_da.Fill(l_ds) DataGrid1.DataSource = l_ds.Tables(0) Catch ex As SqlCeException Dim l_sqlerr As SqlCeError For Each l_sqlerr In ex.Errors MsgBox(l_sqlerr.Message) Next Catch ex As Exception MsgBox(ex.Message) End Try End Sub
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[,,,]
look at this thread...
have u installed this
(http://www.microsoft.com/downloads/d...displaylang=en)
http://www.vbforums.com/showthread.php?t=364268
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.