pleas help needed for the ConnectionString

  • Thread starter Thread starter Naim
  • Start date Start date
N

Naim

Hi,
I m developing my first SmartDeviceApplication.
I want to connect my application (on the Pocket PC not emulator) to an
sqlce database installed on the myDevice folder in the PoketPC, let's
say mydatabase.sdf, and let's say the user id=sa and password=password.
what would be the connection string ?

thank u
 
SqlConnection cn = new SqlCeConnection(@"\MyDevice\myDatabase.sdf");

Not sure about the pwd and username....but try adding them in, it may well
work.

HTH,

Bill
 
YOu can also find some basic SQL How to I type information at
http://samples.gotdotnet.com/quickstart/CompactFramework/doc/sqlcedbcreate.a
spx and information on the connection string at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdatasqlservercesqlceengineclassctortopic.asp


Thanks
Amit
--------------------
From: "William Ryan" <[email protected]>
References: <[email protected]>
Subject: Re: pleas help needed for the ConnectionString
Date: Fri, 17 Oct 2003 10:07:56 -0400
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: nsc66.147.118-145.newsouth.net 66.147.118.145
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.compactframework:36246
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

SqlConnection cn = new SqlCeConnection(@"\MyDevice\myDatabase.sdf");

Not sure about the pwd and username....but try adding them in, it may well
work.

HTH,

Bill


Amit Chopra
Visual Studio for Devices
Microsoft Corp.
 
hi, thanx for ur answers and the links.

the ConnectionString "Data Source=\mydatabase.sdf" is working perfectly
now on the Pocket Device.

but unfortunately it's not working on the emulator.
do i have to change the connectionstring in this case ?

i also tried to copy the .sdf file on the local machine, and specifying
it's path in the connectionstring (like C:\mydatabse.sdf) but the
connection failed.

any ideas?
 
Back
Top