i am trying to connect a database on sql server ce:

connString = "Provider=Microsoft.SQLServer.OLEDB.CE.1.0; Data Source=\\My
Documents\\test.sdf";

conn = new SqlCeConnection(connString);

i got following error:

"Unknown connection option in connection string: provider"

what is the problem here?

Re: connection problem by Jon

Jon
Fri Jul 09 05:42:19 CDT 2004

e-mid <someone@somewhere> wrote:
> i am trying to connect a database on sql server ce:
>
> connString = "Provider=Microsoft.SQLServer.OLEDB.CE.1.0; Data Source=\\My
> Documents\\test.sdf";
>
> conn = new SqlCeConnection(connString);
>
> i got following error:
>
> "Unknown connection option in connection string: provider"
>
> what is the problem here?

Exactly what it says - you're specifying a provider, and it doesn't
know what that is. Look at the SqlCeConnection.ConnectionString
property for more information. You should just be able to get rid of
that part of the connection string, and all will work.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Re: connection problem by e-mid

e-mid
Fri Jul 09 07:23:50 CDT 2004

yes , it works when i cut provider part.
i get this connection string from msdn, it is interesting that it does not
work. i also
tried with version 2.0 but it is no use..

"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1b5886e94cf0612b98ae51@msnews.microsoft.com...
> e-mid <someone@somewhere> wrote:
> > i am trying to connect a database on sql server ce:
> >
> > connString = "Provider=Microsoft.SQLServer.OLEDB.CE.1.0; Data
Source=\\My
> > Documents\\test.sdf";
> >
> > conn = new SqlCeConnection(connString);
> >
> > i got following error:
> >
> > "Unknown connection option in connection string: provider"
> >
> > what is the problem here?
>
> Exactly what it says - you're specifying a provider, and it doesn't
> know what that is. Look at the SqlCeConnection.ConnectionString
> property for more information. You should just be able to get rid of
> that part of the connection string, and all will work.
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too



Re: connection problem by Jon

Jon
Fri Jul 09 07:48:11 CDT 2004

e-mid <someone@somewhere> wrote:
> yes , it works when i cut provider part.
> i get this connection string from msdn, it is interesting that it does not
> work. i also
> tried with version 2.0 but it is no use..

Where did you get it from in MSDN? Was it specifically for use with
SqlCeConnection, or something else?

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Re: connection problem by e-mid

e-mid
Fri Jul 09 08:38:01 CDT 2004

ok , i just noticed that it was an ADOCE connection.
sorry!!

"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1b58a4636382413798ae52@msnews.microsoft.com...
> e-mid <someone@somewhere> wrote:
> > yes , it works when i cut provider part.
> > i get this connection string from msdn, it is interesting that it does
not
> > work. i also
> > tried with version 2.0 but it is no use..
>
> Where did you get it from in MSDN? Was it specifically for use with
> SqlCeConnection, or something else?
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too