Wednesday, March 28, 2012

login failed for user ... Not Associated with a trusted SQL Server

Hello,
I'm trying to connect a mobile computer runing under windows CE to a
database located on a Windows XP desktop.
The mobile computer application is written in C# under Visual Studio .NET
2003.
My problem occurs when I execute mConnection.Open();
A SqlException is caught with this message :
Login failed for user '(null)'. Reason : Not associated with a trusted SQL
Server connection.
here is the connection string :
mConnection = new SqlConnection("User ID=sa;data source=" + mSqlServer +
";Integrated Security=SSPI;initial catalog=IDPS;Password=xxxx;persist
security info=false;Trusted_Connection=yes");
What can I do to correct it ?In your connection string, you are specifying parameters for
both SQL authentication and Windows authentication - it
needs to be one or the other. If you use Windows
authentication, you don't specify a user id and password.
You can find some examples at:
http://www.carlprothman.net/Default...ManagedProvider
-Sue
On Tue, 2 Aug 2005 07:56:11 -0700, Christian F CLY
<ChristianFCLY@.discussions.microsoft.com> wrote:

>Hello,
>I'm trying to connect a mobile computer runing under windows CE to a
>database located on a Windows XP desktop.
>The mobile computer application is written in C# under Visual Studio .NET
>2003.
>My problem occurs when I execute mConnection.Open();
>A SqlException is caught with this message :
>Login failed for user '(null)'. Reason : Not associated with a trusted SQL
>Server connection.
>here is the connection string :
>mConnection = new SqlConnection("User ID=sa;data source=" + mSqlServer +
>";Integrated Security=SSPI;initial catalog=IDPS;Password=xxxx;persist
>security info=false;Trusted_Connection=yes");
>What can I do to correct it ?sql

No comments:

Post a Comment