Re: Database connection from PDA over cradle
- From: Joe [MCSD] <Joe [MCSD]@discussions.microsoft.com>
- Date: Thu, 3 May 2007 10:40:02 -0700
Any one figure this out? I am having the same problem.
As a heads up when I try and hit the server with the name it can't find it
at all (Server not found)
When I use the IP I get a (Server Not Found or Invalid Login)
The login works fine in a standard Windows VP app.
Thanks, Joe
"Ginny Caughey [MVP]" wrote:
Joshua,.
Does it work if you use the ip address for the database instead of the
machine name?
--
Ginny
"Joshua_Wise" <JoshuaWise@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BD55319E-33D3-4A8B-84A5-6FE326A9938F@xxxxxxxxxxxxxxxx
Mario,
Thanks for this. Unfortunately this is exactly what I'm doing, and it's
just not seeing the databases. I'm not sure if it's because the Pocket PC
is
not seeing itself as "on" the network or what, but when I run this code on
my
desktop app, it works fine. When I run it on the pocket PC I get the
error
that the database can not be found.
I've put my code below.
*************CODE********************
Imports System.Data
Imports System.Data.SqlClient
Private myCommand As New SqlCommand("Select * from [beverage_brands
(ap)]")
Private myDS As New DataSet("TEST")
Private myT As DataTable
Private Const SELECT_STRING As String = _
"SELECT * FROM bob.info"
Private Const CONNECT_STRING As String = _
"Data Source=LK65735;Initial Catalog=fds;User ID=sa; Pwd=myPW"
Private m_DataSet As DataSet
'LK65735 is the name of the computer where the MSDE SQL DB is hosted and
running.
'Button click to start the code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim data_adapter As SqlDataAdapter
' Create the SqlDataAdapter.
data_adapter = New SqlDataAdapter(SELECT_STRING, _
CONNECT_STRING)
' Map Table to Contacts.
data_adapter.TableMappings.Add("days", "mydays")
' Fill the DataSet.
m_DataSet = New DataSet()
data_adapter.Fill(m_DataSet)
dgDays.DataSource = m_DataSet.Tables(0)
End Sub
**************END CODE******************
"Mario Aoun" wrote:
Hi Joshua_Wise,
Please find my answers to your questions below:
1. Is this even possible?
Yes, sure it is possible.
2. How would I go about it?
inside the smart device application project, you add a reference to
System.Data.SqlClient and in the connectionstring of your connection you
use
the same string you are using on ur desktop application like the
following:
dim conn As New SqlConnection
conn.ConnectionString =
"server=YOURSERVERNAME_OR_YOURPCNAME;database=YOUR_MSDE_DATABASE;User ID
=YOUR_SQL_LOGIN; Password=YOUR_SQL_PASSWORD"
Good luck
mario
"Joshua_Wise" wrote:
Hi all,
Ok, I have an application on my WM 5.0 device that i developed in
VB.Net
2005. What I want to do is be able to access an MSDE database that is
hosted
on the PC that my device is cradled to. At the moment i can do this by
using
a desktop application that queries the database and then sends the
results to
the PPC as XML files. What I want to be able to do is do a direct data
connection from the PPC application to the database, hence cutting out
the
"middle man" on the desktop.
Two questions then. 1. Is this even possible? 2. How would I go
about
it?
Thanks in advance,
Joshua Wise
- Follow-Ups:
- Re: Database connection from PDA over cradle
- From: Ginny Caughey [MVP]
- Re: Database connection from PDA over cradle
- Prev by Date: Re: windows moble 6.0
- Next by Date: Re: Enabling MMS account/editor on the Pocket PC emulator
- Previous by thread: Trying to implement IObjectSafety onto an MFC activeX control
- Next by thread: Re: Database connection from PDA over cradle
- Index(es):
Loading