Re: How to Direct connect with ActiveSync
- From: MutlyP <MutlyP@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 1 Dec 2008 11:37:02 -0800
Hi Paul
I am going to try this one last time and if you still think I am using old
stuff than I will no longer bother you.
I have one develope machine on that machine I have installed Microsoft SQL
Server 2000 (personal edition), Visual Studio 2008.
All I want to do is down load is the Country from the Customers table in the
Northwind database into a ComboBox. The ComboBox is on a Form in a Smart
Device Project in Visual Studio 2008.
(Opened Visual Studio 2008 clicked on Create Project. New Project window
opens I clicked on Smart Device and then choose Smart Device Project and .Net
Framework 3.5.)
In the Form1_Load I have this code:
Dim sConnection As String = "Data Source=(local);Initial
Catalog=Northwind;User ID=csInfo;Password=csInfo;"
Dim sSQL As String = "SELECT DISTINCT Country FROM Customers ORDER
BY Country"
Dim comm As SqlCommand = New SqlCommand(sSQL, New
SqlConnection(sConnection))
Dim dr As SqlDataReader = Nothing
Try
comm.Connection.Open()
dr = comm.ExecuteReader
While dr.Read
cboCountries.Items.Add(dr(0))
End While
Catch ex As Exception
MessageBox.Show(ex.Message)
Return
End Try
dr.Close()
comm.Connection.Close()
End Sub
I run this and get the "Can't find Server or Access Denied".
Like I said I made sure port 1433 is being used, I changed the name of the
server in the code to the IP address and turned off both Firerwalls that are
on my computer.
If I run the exact same code in a regular projcet (Not a Smart Device
Project) it runs fine.
Again sorry if this should be in another form but you say that SQL Server
2000 is old but I read nothing that Visual Studio 2008 does not work with SQL
Server 2000. My web connections and desktop project connections to SQL Server
2000's databases. It's just the Smart Device.
Any ideas?
Thanks for all your help.
Matt
"Paul G. Tobey [eMVP]" wrote:
Again, you're using really old stuff in combination with the newest stuff..
If you're trying to connect "from Visual Studio", you mean through the
Server Explorer? I almost never use that, so I can't tell you what's going
on. Read the help and verify that you can do that with that version of the
server from VS2008. Maybe the server requires a user name and password and
you aren't giving it. Maybe you're identifying the server you're trying to
connect to incorrectly (wrong name, wrong IP, wrong whatever). Maybe the
server isn't set up to allow TCP/IP connections.
All I can tell you is that VS2008 works fine with SQL Server 2005 and so
does .NET CF 3.5 with the SQL CE client. If you still want to try to get
this desktop-to-desktop connection working and can't, I'd suggest that you
ask about *that* in an SQL Server group. That question has nothing to do
with SQL Server CE, does it?
Paul T.
"MutlyP" <MutlyP@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:46096AA0-8E5D-4ED3-9D99-9B4096A5DEE9@xxxxxxxxxxxxxxxx
Paul
I have tried to connect to the Northwind data base that is on SQL 2000
using
Visual Studio 2008 and I keep getting the error "Server does not exist or
access is denied" I made sure that SQL was on port 1433 and turned off all
my
firewalls and I am still getting the "Server does not exist or access is
denied"
Please help.
Thanks
"Paul G. Tobey [eMVP]" wrote:
Well, I don't write in VB.NET, but it seems to me that you'd use the
SqlConnection class, with a suitable connection string. You're using a
very
old version of SQL Server, older than I've ever used with a .NET Compact
Framework client, so I'm not sure that it will work (and I'm sure it
won't
be supported, even if it does). You also haven't told us what version of
the .NET Compact Framework you're going to put on the device, so there
might
be some cavaets, depending on that. Something roughly like this:
imports System.Data.SqlClient
....
sql = New SqlConnection("Data Source=<name or IP of SQL Server
machine>;Initial Catalog=<name of database>;User ID="<name of
user>";password="<password for user>";")
sql.Open()
....
Paul T.
"MutlyP" <MutlyP@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1B912628-7601-405B-9596-E11C55F230B6@xxxxxxxxxxxxxxxx
Paul
Can you give me a link to some code samples in VB on how to do this?
Thanks
Matt
"Paul G. Tobey [eMVP]" wrote:
You should be able to treat the ActiveSync connection as a network
connection, like wired Ethernet (NOT WIRELESS ;-). Have you tried
this
and
found a problem? The code would be no different than the wireless
code,
of
course, since it's just a network.
Paul T.
"MutlyP" <MutlyP@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AF059081-FB02-46E1-BCE0-25D8E058293A@xxxxxxxxxxxxxxxx
I hope someone can help me on this one it is driving me crazy.
I have Mobile 6 device connected to my desktop computer through a
wire
,(NOT
wireless, repeat NOT WIRELESS) useing ActiveSync.
What I need to do is have the device connect to the SQL Server 2000
database
that is on my intranet and download data from tables in that
database
to
the
tables in the database that is on my device. I beleive it's called
Direct
Connect. I can not find any example code on how to do this. On the
net
it's
all about wireless connections, or merge and replication, but I
can't
do
those because of my companies security policies.
Please help
Thank You
Matt
- Follow-Ups:
- Re: How to Direct connect with ActiveSync
- From: Paul G. Tobey [eMVP]
- Re: How to Direct connect with ActiveSync
- References:
- Re: How to Direct connect with ActiveSync
- From: MutlyP
- Re: How to Direct connect with ActiveSync
- From: Paul G. Tobey [eMVP]
- Re: How to Direct connect with ActiveSync
- Prev by Date: Re: How to Direct connect with ActiveSync
- Next by Date: Re: How to Direct connect with ActiveSync
- Previous by thread: Re: How to Direct connect with ActiveSync
- Next by thread: Re: How to Direct connect with ActiveSync
- Index(es):
Relevant Pages
|
Loading