Results 1 to 11 of 11

Thread: Connection from Pocket to sqlServer

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    31

    Connection from Pocket to sqlServer

    Hi,

    For a project at evening school I've decided to do something with pocket PC. No real reason why, it seemed like fun and I never worked with it, so it would be a good experience too.

    I'm using the emulator (VS2003) and I'm trying to get data, stored in a database on sqlServer (located on the same PC as VS).
    I've tried several things, trying out different ways to make a connection to the database but none work and basically I have no clue.
    What is it exactly that I have to differently, to making a local connection (something I have done before quite regularly)?

    Before you start telling me to use sqlCE, I have to say to say that is not the solution I'm looking for or even need, as I understand it, sqlCE is a database manager that runs on the pocket pc itself. The program eventually needs to support several pocket PC's all using the data from the server.

    Thanks in advance.

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

    Re: Connection from Pocket to sqlServer

    If you want to connect directly from the PocketPC into SQLServer you will need to use the SQLClient libraray. You need to add a reference to SQLClient in the project.

    So all you need do next is add Imports System.Data.SqlClient to the top of the class

    Private m_cn As SqlConnection
    Dim l_connString As String
    l_connString = "user id=sa;password=;database=myDB;Server=192.168.10.180"

    m_cn = New SqlConnection(l_connString)
    m_cn.Open()
    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
    Junior Member
    Join Date
    Apr 2005
    Posts
    31

    Re: Connection from Pocket to sqlServer

    Thanks mate, I think I'm getting closer.

    However, I keep getting an SQL error the moment I try to open the connection (it hangs for about two minutes in the debugger).
    The error I get btw is: "SQL server does not exist or acces denied"

    Any ideas why that is and how I solve it?

    If I don't have a password, i can take that part off, right? Not that it changes anything if I don't, tried various things.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    31

    Re: Connection from Pocket to sqlServer

    Wow!!!

    I've solved it!!! Not sure how though.

    What I did, after reading some article I got here:
    http://msdn.microsoft.com/library/de...ceProjects.asp

    I installed that loopback network thingy and tried again.
    That in itself didn't work but when I changed the IP adres for it to the one you gave me and it's subnet...Cha-Ching!!!!

    First time lucky I guess.

    Thanks again mate for taking your time, couldn't have done it without you.

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

    Re: Connection from Pocket to sqlServer

    no problem!!!!!
    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

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    31

    Re: Connection from Pocket to sqlServer

    This one must be quite original...

    I can get it to work on VS2003 (2002emulator) but not on VS2005 (2003emulator).
    No matter what I do, I get and "acces denied or server does not exist" error.

    Anyone any idea why?

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

    Re: Connection from Pocket to sqlServer

    havent had the time to move to vs2005 yet.... but if you solve it tell us how as im sure ill encounter the same problem
    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

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    31

    Re: Connection from Pocket to sqlServer

    I tried all night and read about a thousand posts on this problem - before coming here - but none that helped (though I didn't know it worked in VS2003 at the time, that I just found ).

    Maybe I should do a reinstall, I have too much running on my PC at the moment, too many VS and SQL versions, perhaps something is causing a conflict somewhere.
    yeah, I know, it is last chance saloon...

  9. #9
    Member
    Join Date
    Mar 2005
    Posts
    56

    Re: Connection from Pocket to sqlServer

    Quote Originally Posted by alva
    Wow!!!

    I've solved it!!! Not sure how though.

    What I did, after reading some article I got here:
    http://msdn.microsoft.com/library/de...ceProjects.asp

    I installed that loopback network thingy and tried again.
    That in itself didn't work but when I changed the IP adres for it to the one you gave me and it's subnet...Cha-Ching!!!!

    First time lucky I guess.

    Thanks again mate for taking your time, couldn't have done it without you.

    can you give me more detail?
    I try it a long time, the sqlclient do not work in ppc emulator, but it work in "real" pocket pc, what setting do I need? THX

  10. #10
    New Member
    Join Date
    Apr 2006
    Posts
    2

    Re: Connection from Pocket to sqlServer

    The VS2005 doesn't have support for the latest Windows CE Emulator yet. But you can try downloading the separate WinCE emulator(which is now in version 5 in Microsoft Downloads) and install it in your pc. The annoying part is that, you have to to create a cab file each time you want to test your application and deploy the cab in the WinCE emulator.

  11. #11
    Member
    Join Date
    Mar 2005
    Posts
    56

    Re: Connection from Pocket to sqlServer

    yep,It is good idea, but I want to create wince 2003se software with vs2003.

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