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. :D
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. :)
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()
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.
Re: Connection from Pocket to sqlServer
Wow!!!
I've solved it!!! Not sure how though. :D
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. :D
Thanks again mate for taking your time, couldn't have done it without you. :thumb:
Re: Connection from Pocket to sqlServer
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?
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
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... :D
Re: Connection from Pocket to sqlServer
Quote:
Originally Posted by alva
Wow!!!
I've solved it!!! Not sure how though. :D
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. :D
Thanks again mate for taking your time, couldn't have done it without you. :thumb:
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
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.
Re: Connection from Pocket to sqlServer
yep,It is good idea, but I want to create wince 2003se software with vs2003.