Connection from CE emulator to SQL server

G

Guest

Hi,
I have created a simple vb .net Smart device app in VS .NET. One form with
a button, on the click event, I attempt to open a connection to the MS SQL db
on my local development box that I am on. The open always fails with an SQL
exception. I put the same code in a Window Form app, works fine, so I know
the conncetion is good, but of course that is not from the emulator. I just
don't think the Win CE emulator sees my SQL db. (Thanks to others here
pointing that out to me)
How can I make this happen. I have been reading for a day or so, just can't
find it.

Here is the code:

Dim mySelectQuery As String = "SELECT OrderID, CustomerID FROM Orders"
Dim myConnection As New SqlConnection("User ID=sa;Password=;Initial
Catalog=Northwind;Data Source=COMPUTER-CD9T4F;")
Dim myCommand As New SqlCommand(mySelectQuery, myConnection)
myConnection.Open()

Thanks,
Steve
 
P

Peter Foot [MVP]

Can you substitute the ip address of your desktop machine instead of the
name, does that help?

Peter
 
G

Guest

Nope, still got the error on the open(). I went to a browser on the
emulator and typed in //IP, it came up with a security box asking for userid
and password. I typed in the sa and left the password blank, but that didn't
work.

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top