1

Closed

Login Failed

description

I am trying to use the toolkit to generate local database cache code but I get a login failed error to my sql server db. The SQL Server databbase is 2008 (not R2). I am able to create a datasource in VS 2010 in this same project. I am also able to use SSMS from this machine to the database.
 
While creating the connection properties I am using SQL Server credentials and the "Test Connection" button returns: "The connection succeeded" and I am able to choose from the databases on the instance dropdown.
 
 
The error is:
 
Message: Login failed for user 'xxxx'.
Source : .NetSqlClient Data Provider
Number : 18456

file attachments

Closed Aug 29, 2012 at 7:13 PM by ErikEJ
In 3.1

comments

ErikEJ wrote May 21, 2012 at 4:59 PM

Check the code at the beginning of the Synchronize method, that the connections strings there are valid.

stokara wrote May 22, 2012 at 9:53 PM

My error occurs when I am in VS 2010 when I right click on "Generate Local Database Cache code... before any code is generated. Is there a way to view the code template ?

ErikEJ wrote May 23, 2012 at 6:20 AM

We just use the built-in VS connection dialog - you can download the source and have a look.

stokara wrote May 23, 2012 at 3:59 PM

I found the problem. In the dialog, I am choosing SQL Server credentials and the password is not included in the DataConnectionDialog.DisplayConnectionString so the connection to the database fails. I tried switching to DataConnectionDialog.EncryptedConnectionString but this caused downstream errors.

While I did get past this by using Windows credentials I am now getting another error trying to generate local cache code. I've attached a screen shot in the file below

ErikEJ wrote May 23, 2012 at 7:28 PM

Thanks for pointing out this general SQL login issue. Did you try the "Save my Password" checkbox?
Is you project under source control?

ErikEJ wrote May 23, 2012 at 7:33 PM

You need to have Sync Framework 2.1 installed - check the About button on the Toolbox toolbar...

ErikEJ wrote May 24, 2012 at 10:54 AM

I have created a work item to change Server Connection handling in the Toolbox to use another method...

wrote May 25, 2012 at 11:56 AM

Fixed on changeset 78323