Results 1 to 11 of 11

Thread: mobile application cannot see remote sql server

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2010
    Posts
    5

    Unhappy mobile application cannot see remote sql server

    Hello all,

    I am sorry for bothering you with my probably low level question.

    I would like to develop a very very very simple application which will connects the MS SQL SERVER in my notebook and will be run at hand terminal-with windows mobile 6.

    Here is the code which i used :
    Dim strSQL As [String] = "SELECT COUNT(studentid) AS totalp from Students where gender='m' "
    ' Dim Conn As New SqlConnection("Data Source=10.0.0.4\MUSTAFASQL2;Initial Catalog=MYDBX;User ID=TEACHERA") <<< i used this too,
    ' Dim Conn As New SqlConnection("Data Source=10.0.0.4:1433\MUSTAFASQL2;Initial Catalog=MYDBX;User ID=TEACHERA;") <<< and also tried this
    Dim conn As New SqlConnection("Data Source=MUSTAFA\MUSTAFASQL2;Initial Catalog=MYDBX;User ID=TEACHERA;")
    Conn.Open() <<<<<<<<< crashes here with this error : "Specified SQL server not found : MUSTAFA\MUSTAFASQL2"

    Dim cmd As New SqlCommand(strSQL, Conn)
    Dim musreader As SqlDataReader = cmd.ExecuteReader
    While musreader.Read
    total.Text = musreader.Item("totalp").ToString
    End While
    Conn.Close()

    on button click.

    Some details :
    Device : Windows Mobile 6.1 classic
    Local : SqlExpress and i can reach from many computers, i mean there is no problem accessing remotely to my SQL Server.

    Please help me, all helps are appreciated. Thanks a lot.
    Please let me know if you need to know more details for help...

  2. #2

    Thread Starter
    New Member
    Join Date
    Jun 2010
    Posts
    5

    Re: mobile application cannot see remote sql server

    here is the error code i received on conn.open()

    ---------------------------------------------------------

    at System.Data.SqlClient.SqlConnection.OnError()

    at System.Data.SqlClient.SqlInternalConnection.OnError()

    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()

    at System.Data.SqlClient.TdsParser.Connect()

    at System.Data.SqlClient.SqlInternalConnection.OpenAndLogin()

    at System.Data.SqlClient.SqlInternalConnection..ctor()

    at System.Data.SqlClient.SqlConnection.Open()

    at MobilgSTS1.Form1.Form1_Load()

    at System.Windows.Forms.Form.OnLoad()

    at System.Windows.Forms.Form._SetVisibleNotify()

    at System.Windows.Forms.Control.set_Visible()

    at System.Windows.Forms.Application.Run()

    at MobilgSTS1.Form1.Main()

    ---------------------------------------------------------

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

    Re: mobile application cannot see remote sql server

    Hi,
    search the forum - there was a big discussion on this, and how to connect to SQL Express.

    Should be something like:-
    Dim Ccon As New SqlConnection("Persist Security Info=False;Integrated Security=False;Server=10.0.0.4;initial catalog=MYDBX_Data;user id=TEACHERA;password=mypassword;")

    Pete
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  4. #4

    Thread Starter
    New Member
    Join Date
    Jun 2010
    Posts
    5

    Re: mobile application cannot see remote sql server

    it failed with this connectionstring!

    You are right! I'd betta if i search forum.

    Thanks a lot

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

    Re: mobile application cannot see remote sql server

    Can you ping your server from your device?
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: mobile application cannot see remote sql server

    Does your mobile device support wireless? I don't mean 3G wireless... I mean, does it have WiFi? If it does... then it needs to be connected to the network in order to run. Otherwise...it just isn't going to work.

    That's why, as the error tells you: "Specified SQL server not found : MUSTAFA\MUSTAFASQL2" because, to your device, it doesn't exist.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  7. #7

    Thread Starter
    New Member
    Join Date
    Jun 2010
    Posts
    5

    Re: mobile application cannot see remote sql server

    Yes,
    Device has wi-fi capability and i can ping the server (10.0.0.4) but cannot see database.
    At the other hand, all other client PCs can reach server and database except mobile device.

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

    Re: mobile application cannot see remote sql server

    Is it SqlServer or Sql Express?

    Is there an 'instance'?

    The line below is taken from a working config file, connecting to SQL Express on port 1334

    Persist Security Info=False;Integrated Security=False;Server=Till1\SqlExpress,1334;initial catalog=Waiter_BlackBull;user id=sa;password=elcastillo;

    HTH
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  9. #9

    Thread Starter
    New Member
    Join Date
    Jun 2010
    Posts
    5

    Re: mobile application cannot see remote sql server

    Yes, there is an instance, it's sql express and i tried your last connectionstring as well. But it still fails!!!

    But i found an information but dont know exactly what it means :

    - You have to install MS Loopback Adapter and you must give an IP to the emulator as well.

    Do you know how to configure/setup Loopback adapter??

    Thank you

  10. #10
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: mobile application cannot see remote sql server

    Wait.... is the problem ocurring when you run the app in the emulator? Or on the actual device itself?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

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

    Re: mobile application cannot see remote sql server

    Quote Originally Posted by techgnome View Post
    Wait.... is the problem ocurring when you run the app in the emulator? Or on the actual device itself?

    -tg
    Same question from me

    Even in the emulator - you don't need a loopback

    Here is a thread on the whole subject - http://www.vbforums.com/showthread.p...ght=SQLExpress

    from http://netcf2.blogspot.com/2005/12/a...ress-from.html
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

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