PC Review


Reply
Thread Tools Rate Thread

Connection to Database (SQL CE)

 
 
SiewSa
Guest
Posts: n/a
 
      10th Mar 2004
I have tried on this for so long but it just never works for me. Here are
my two questions and I am very appreciate if someone can help me on them:

1) My connection coding...

Dim myConnection As New SqlCeConnection("Data Source=\Stephan\mobiledb.sdf")

Error Code : 80004005

Message: The path is not valid, check the directory for the database [,,,
Path ,,].

But, I am pretty sure that I have put the .sdf file in that particular
directory. Am I doing something wrong on just copy the .sdf file to that
directory?

2) SqlCeDataAdapter
Dim myDataAdapter As New SqlCeDataAdapter

When I try to declare a SqlCeDataAdapter, the PC will prompt me an error as
the below:

"Reference required to assembly 'System.Data.Common' containing the base
class 'System.Data.Common.DbDataAdapter'. Add one to your project."

However, even though I have imported System.Data.Common in my class, it
never help. By the way, I am not able to locate the
System.Data.Common.DbDataAdapter namespace. My dotnet framework version is
1.1. Is that the problem of versions??? Or, there are some other reasons?
Indeed, I have already imported the 'System.Data.SqlServerCe' Namespace.

That's pretty much of them and I would like to thank in advance to someone
from you all who is helping me out. Thanks.


 
Reply With Quote
 
 
 
 
Lloyd Dupont
Guest
Posts: n/a
 
      10th Mar 2004
if you put it at the root of the mobile in the explorer view, then it is
\My Documents\Stephan\mobiledb.sdf

you should reference both the following dll in your project (DLL = different
namespace) System.Data.dll & System.Data.Common.dll (and maybe
System.Data.SqlClient.dll too)

"SiewSa" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I have tried on this for so long but it just never works for me. Here are
> my two questions and I am very appreciate if someone can help me on them:
>
> 1) My connection coding...
>
> Dim myConnection As New SqlCeConnection("Data

Source=\Stephan\mobiledb.sdf")
>
> Error Code : 80004005
>
> Message: The path is not valid, check the directory for the database [,,,
> Path ,,].
>
> But, I am pretty sure that I have put the .sdf file in that particular
> directory. Am I doing something wrong on just copy the .sdf file to that
> directory?
>
> 2) SqlCeDataAdapter
> Dim myDataAdapter As New SqlCeDataAdapter
>
> When I try to declare a SqlCeDataAdapter, the PC will prompt me an error

as
> the below:
>
> "Reference required to assembly 'System.Data.Common' containing the base
> class 'System.Data.Common.DbDataAdapter'. Add one to your project."
>
> However, even though I have imported System.Data.Common in my class, it
> never help. By the way, I am not able to locate the
> System.Data.Common.DbDataAdapter namespace. My dotnet framework version

is
> 1.1. Is that the problem of versions??? Or, there are some other

reasons?
> Indeed, I have already imported the 'System.Data.SqlServerCe' Namespace.
>
> That's pretty much of them and I would like to thank in advance to someone
> from you all who is helping me out. Thanks.
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question re: Frontpage/Database Connection (protected database) CGeek Microsoft Frontpage 2 20th Jun 2008 03:35 AM
Database Connection - Not Associated With Trusted Connection Mythran Microsoft ASP .NET 5 5th Oct 2005 11:50 PM
Creating Database Connection at runtime and writing Connection String to App.Config.. ROO Microsoft VB .NET 1 12th Apr 2005 09:19 PM
database connection lori Microsoft Access 0 5th Oct 2003 09:35 PM
DataBase connection varun varun Microsoft ASP .NET 1 7th Jul 2003 01:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:12 PM.