Skip to main content

SQL Compact edition 2005

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [.NET Compact Framework Development] >> .NET Compact Framework - VB.NET >> SQL Compact edition 2005 Page: [1]
Login
Message << Older Topic   Newer Topic >>
SQL Compact edition 2005 - 4/3/2008 10:41:28 PM   
gilkaths

 

Posts: 115
Score: 0
Joined: 5/6/2005
Status: offline
Hello,

I'm having a problem when connecting to my sdf database using sqlserverce. Myconnection string is "Data Source = \my.sdf;Password=testing;Persist Security Info=False;". When I execute the cnce.open, it catches an exception but it doesn't display any error description.  I'm running the application in Windows CE 5.0.  Please help.
Post #: 1
RE: SQL Compact edition 2005 - 4/4/2008 3:39:31 AM   
petevick


Posts: 3320
Score: 0
Joined: 4/26/2002
From: Bolton - UK
Status: offline
Hi,
I just use 'Data Source=' and don't use 'Persist security' etc

Try that

Pete

_____________________________

Pete Vickers - Microsoft MVP - Device Application Development
www.gui-innovations.com

Please do not email me with questions. Posting your questions in the forums will get a quicker response - Thanks.

(in reply to gilkaths)
Post #: 2
RE: SQL Compact edition 2005 - 4/4/2008 7:34:38 AM   
gilkaths

 

Posts: 115
Score: 0
Joined: 5/6/2005
Status: offline
Hello Pete,

Here is my code

           Using cnce As New SqlCeConnection(PDAConstr)
               cnce.Open()
               cmce = cnce.CreateCommand
               cmce.CommandText = "SELECT * FROM USERS WHERE US_USERID='" & txtCode.Text.Trim & "'"
               Using rs As SqlCeDataReader = cmce.ExecuteReader
                   If rs.Read Then
                       goGo = True
                   End If
               End Using
           End Using

the error occurs in the part of cnce.open.  The exception have no description.  What is the problem?

(in reply to petevick)
Post #: 3
RE: SQL Compact edition 2005 - 4/4/2008 11:47:20 AM   
petevick


Posts: 3320
Score: 0
Joined: 4/26/2002
From: Bolton - UK
Status: offline
Have you tried the connection string i suggested?
"Data source=\my.sdf;password=testing;"
?


_____________________________

Pete Vickers - Microsoft MVP - Device Application Development
www.gui-innovations.com

Please do not email me with questions. Posting your questions in the forums will get a quicker response - Thanks.

(in reply to gilkaths)
Post #: 4
RE: SQL Compact edition 2005 - 4/4/2008 10:03:39 PM   
gilkaths

 

Posts: 115
Score: 0
Joined: 5/6/2005
Status: offline
Hello Pete,

Yes, i already tried your suggestion.  In fact, it already worked in Windows Mobile 5 based PDA, but when i tried it in Windows CE 5.0, it generates error without any error description. 

(in reply to petevick)
Post #: 5
RE: SQL Compact edition 2005 - 4/15/2008 5:23:43 AM   
gilkaths

 

Posts: 115
Score: 0
Joined: 5/6/2005
Status: offline
Hello Pete,

Do i need to check my version of Compact Edition.  I tried opening the sdf file in the sqlclient inside WinCE5.0 and it open successfully.  Any suggestions?  It still won't work.  Please help.

(in reply to petevick)
Post #: 6
RE: SQL Compact edition 2005 - 4/15/2008 9:05:59 AM   
petevick


Posts: 3320
Score: 0
Joined: 4/26/2002
From: Bolton - UK
Status: offline
Does the Query Analyzer tool work in your version of Windows CE?

I don't understand
quote:

"I tried opening the sdf file in the sqlclient inside WinCE5.0 and it open successfully"


_____________________________

Pete Vickers - Microsoft MVP - Device Application Development
www.gui-innovations.com

Please do not email me with questions. Posting your questions in the forums will get a quicker response - Thanks.

(in reply to gilkaths)
Post #: 7
RE: SQL Compact edition 2005 - 4/15/2008 9:27:11 PM   
gilkaths

 

Posts: 115
Score: 0
Joined: 5/6/2005
Status: offline
Hello Pete,

Sorry, I'll rephrase my sentence. I mean, the sdf file works in the Query Analyzer in the device.  What can be the problem?

(in reply to petevick)
Post #: 8
RE: SQL Compact edition 2005 - 4/16/2008 8:35:37 AM   
petevick


Posts: 3320
Score: 0
Joined: 4/26/2002
From: Bolton - UK
Status: offline
Hi,
all I can think is that you may have 2 versions on your device.

I am surprised that it catches an exception, yet doesn't show an error message.

What happens if you step through, and display 'ex' (if that is your exception), err.number and err.description?
Pete

_____________________________

Pete Vickers - Microsoft MVP - Device Application Development
www.gui-innovations.com

Please do not email me with questions. Posting your questions in the forums will get a quicker response - Thanks.

(in reply to gilkaths)
Post #: 9
RE: SQL Compact edition 2005 - 5/2/2008 9:28:28 PM   
gilkaths

 

Posts: 115
Score: 0
Joined: 5/6/2005
Status: offline
Hello,

When I displayed the err.number and err.description. It doesn't display anything. Do I need to create the sdf file through code?

(in reply to gilkaths)
Post #: 10
RE: SQL Compact edition 2005 - 5/5/2008 7:31:36 AM   
gilkaths

 

Posts: 115
Score: 0
Joined: 5/6/2005
Status: offline
Hello Pete,

Maybe i installed the wrong cab files.  Which cab file must i used to install the SQL Server 2005 Compact edition in Windows CE 5.0?  Please help.

(in reply to gilkaths)
Post #: 11
RE: SQL Compact edition 2005 - 5/6/2008 4:17:42 AM   
petevick


Posts: 3320
Score: 0
Joined: 4/26/2002
From: Bolton - UK
Status: offline
I install
sqlce30.wce5.armv4i.CAB
from
C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v3.0\wce500\armv4i

Pete

_____________________________

Pete Vickers - Microsoft MVP - Device Application Development
www.gui-innovations.com

Please do not email me with questions. Posting your questions in the forums will get a quicker response - Thanks.

(in reply to gilkaths)
Post #: 12
Page:   [1]
All Forums >> [.NET Compact Framework Development] >> .NET Compact Framework - VB.NET >> SQL Compact edition 2005 Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.5.5 Unicode

0.031