Click here to Skip to main content
15,898,538 members

Comments by Member 10250878 (Top 4 by date)

Member 10250878 12-Sep-15 13:20pm View    
1) I connect using the default authentication which is Windows auth.
2) In the app there is a window that creates sql server login. On the submit button, it creates the login and gets the username and the login password from the textbox.
3) My code changes the connection string after creating the login(integrated security=false). Which means I can only login with credentials or sql server authentication.

Thats the process it follows. Then if I try to login it won't connect because I need to alter or change the login password. I wrote an alter query in my wpf app and it didn't work. Then I had to go 2 sql management studio to alter my login and tried it again in my wpf app, then it works.

I know your a little confused but the app works like sql management studio where you need to connect to a server first before you can do anything.
Member 10250878 12-Sep-15 9:56am View    
Hi mika, I can login from my app using windows authentication and sql server authentication only when i change my password in management studio. My code changes the integrated security at runtime and also generate connection strings. Its purpose is to support online or local (multiuser) connections. But, I am trying to change my password of my login I created in windows authentication mode and log in with the credentials In sql server authentication mode.
Member 10250878 12-Sep-15 9:22am View    
Not still working.

I wrote this code in c# using sqlcommand object and it works. But, when I try to login with the credentials in my app, it doesn't work. It only works if I change my password or alter my password in sql management studio.

sqlcommand.commandTest:

CREATE LOGIN remoteUser
WITH PASSWORD = 'mypass123'; GO

-- Creates a database user for the login created above. CREATE USER remoteUser FOR LOGIN remoteUser GO
Member 10250878 20-Apr-15 15:48pm View    
I just forget about the "where not exists" syntax. Anyways, i created a stored procedure for it and i used EF to call it.

Regards.