Re: How to Direct connect with ActiveSync



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









.



Relevant Pages

  • Re: Best Way to Distribute a Winform Application
    ... Would I be able to get any help with Visual Studio 2005 beta if I had ... Server or would a server upgrade be needed in order to use Visual Studio 2005? ... > the SQL server machine, you can use msi, xcopy or no-touch deployment as you ... > Using no-touch deployment is a matter of choosing between a couple options. ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: VB app connect THROUGH proxy to a remote SQL database
    ... The whole "HTTP proxy is way more secure than allowing outgoing ... the client app and the SQL server are on ... incoming connections to the SQL server are not the problem - it's ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Access 2007->SQL Server2005 "connection was forcibly closed",G
    ... If I cut the maximum number of connections to for ... SQL Server simply blocks any further try to open another table until I close ... This doesn't happen with the SQL Server 2000 but with SQL Server ... No, I think ms-sql-s means that SQL 2000 is using port 1433, which is ...
    (microsoft.public.sqlserver.connect)
  • Re: how to allow creation of databases
    ... But if I try and use it from Visual Studio to create a database, ... > Since your development server is not a member of a domain, ... You can configure SQL Server to use both authentication ...
    (microsoft.public.sqlserver.security)
  • Re: Fehlerhafte ODBC-Datenerweiterung bei den Reporting Services
    ... MSDN Webcast: Intelligent Reporting: Using the Visual Studio 2005 Report Viewer Controls ...
    (microsoft.public.de.sqlserver)

Loading