none
windows mobile smartphone 模擬器連接資料庫疑問 RRS feed

  • 問題

  • 各位前輩

    小弟目前遭遇一個問題

    就是撰寫好replication的程式進行編譯後

    每次模擬器都說開啟SQL mobile server失敗

    請問各位前輩

    這是什麼原因呢

    程式碼如下:

    Imports System
    Imports System.Data
    Imports System.Data.SqlServerCe
    Imports System.Xml
    Imports System.IO

    Private Sub MenuItem2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
         Dim repl As New SqlCeReplication

            Try
                If False = File.Exists("db\db.sdf") Then
                    repl.AddSubscription(AddOption.CreateDatabase)
                    repl.PublisherSecurityMode = SecurityType.DBAuthentication
                    repl.PublisherLogin = "administrator"
                    repl.PublisherPassword = "seedlious"

                    repl.Publisher = "USER" '電腦名稱
                    repl.PublisherDatabase = "sch-plant"
                    repl.Publication = "mplant"
                    repl.InternetUrl = "http://user/test/sqlcesa30.dll"
                    repl.InternetLogin = "administrator"
                    repl.InternetPassword = "seedlious"
                    repl.Subscriber = "mymobile"

                Else
                    repl.LoadProperties()
                    repl.Synchronize()
                    Label1.Text = "ok"
                End If

            Catch ex As SqlCeException  
                Label1.Text = ex.Message
            End Try
        End Sub

    2007年2月28日 上午 09:15

所有回覆