PDA connect to SERVER DB problem

  • I have created a PDA Application where the user will have to login so that he can download data into the PDA. The application will check the username + password of the user with the server db.

    I'm having problem connecting to the server DB. The error is SQL SERVER NOT FOUND : WENDY

    CODE:


    Private Sub cmdLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogin.Click

            Dim conString As String = _

            "Data source=WENDY;trusted_connection = true;user id = mpts; password=mpts; database = mpts"

           

            Dim query As String = _

            "SELECT POSTMAN_ID FROM POSTMAN WHERE USERNAME ='" & txtUsername.Text & "' AND PASSWORD ='" & txtPassword.Text & "'"

            Dim con As New SqlConnection(conString)

            Dim cmndDB As New SqlCommand(query, con)

            Dim dr As SqlDataReader

            Try

                con.Open()

            Catch ex As SqlClient.SqlException

                MessageBox.Show(ex.Message)

            End Try

            dr = cmndDB.ExecuteReader()

            If dr.Read() Then

                lblResult.Text = "Logged On"

            Else

                lblResult.Text = "Incorrect username"

            End If


    Can anybody help me? The database name is correct, login and password is correct. This application will connect to the database using intranet(wifi) without the use of the cradle.

  • ! I'm not sure if this will work but, give it a try if you want to

    Try and change your connection string to the following: «Server={SERVER_NETWORK_NAME}\{SQLSERVER_INSTANCE_NAME}; Initial Catalog={DATABASE_NAME}; User ID={USER_NAME}; Password={USER_PASSWORD}» -- This would become something like the following (in your case):

    Check if you have an instance created appart from the default one. If not, the «instance name» part isn't applicable.

    "Server=WENDY\SQLINSTANCE;Initial Catalog=mpts;User ID=mpts;Password=mpts"

    If your PDA is registered on the server(being a windows server system) as a trusted user(trusted connection -» Integrated Security - SSPI) - Usually PDAs running Windows Mobile 2003, 1st and 2nd edition, do this - you can remove the «user id» and «password» keywords and replace them by : "Integrated Security=SSPI" - It should be easier this way.

    Hope this helps

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply