Tuesday, February 14, 2012

connection string

I use sa account to establish connection from .NET web application with SQL
database.
Now I have to use windows authentication and any combination of windows
accounts with different rights have been failed. I'm always getting the same
error:
System.Data.SqlClient.SqlException: Login failed for user 'username'.
any ideas will be appreciated.
Thanks,Hi,
You want to use Integrated Security, right?
cnn.ConnectionString = "integrated security=SSPI;data source=" & dbServer &
";" & _
"persist security info=False;initial catalog=VPOInventory"
HTH
--
Dan Artuso, MVP
"Alan" <Alan@.discussions.microsoft.com> wrote in message news:76566908-5D49-4A5E-8F0C-343B9
1CD0FE2@.microsoft.com...
> I use sa account to establish connection from .NET web application with SQ
L
> database.
> Now I have to use windows authentication and any combination of windows
> accounts with different rights have been failed. I'm always getting the sa
me
> error:
> System.Data.SqlClient.SqlException: Login failed for user 'username'.
> any ideas will be appreciated.
> Thanks,
>|||Check to see if you are using mixed mode for sql server
authentication(windows/sa).That might be your problem.you might have used 's
a
authentication only'
"Alan" wrote:

> I use sa account to establish connection from .NET web application with SQ
L
> database.
> Now I have to use windows authentication and any combination of windows
> accounts with different rights have been failed. I'm always getting the sa
me
> error:
> System.Data.SqlClient.SqlException: Login failed for user 'username'.
> any ideas will be appreciated.
> Thanks,
>|||check to see if you are using mixed mode sql server authentication.that migh
t
be your problem.you might be using 'sa only' authentication.
"Alan" wrote:

> I use sa account to establish connection from .NET web application with SQ
L
> database.
> Now I have to use windows authentication and any combination of windows
> accounts with different rights have been failed. I'm always getting the sa
me
> error:
> System.Data.SqlClient.SqlException: Login failed for user 'username'.
> any ideas will be appreciated.
> Thanks,
>|||did it help?
"Alan" wrote:

> I use sa account to establish connection from .NET web application with SQ
L
> database.
> Now I have to use windows authentication and any combination of windows
> accounts with different rights have been failed. I'm always getting the sa
me
> error:
> System.Data.SqlClient.SqlException: Login failed for user 'username'.
> any ideas will be appreciated.
> Thanks,
>|||Hello Alan,
Also, please never use SA in your application. You should create an account
for your application to run as and only grant the necessary permissions to
that user. The same goes for Windows Authentication. Don't grant the user
you use for running your application membership into the system administrato
rs
role.
Aaron Weiker
http://aaronweiker.com/
http://sqlprogrammer.org/

> I use sa account to establish connection from .NET web application
> with SQL
> database.
> Now I have to use windows authentication and any combination of
> windows
> accounts with different rights have been failed. I'm always getting
> the same
> error:
> System.Data.SqlClient.SqlException: Login failed for user 'username'.
> any ideas will be appreciated.
> Thanks,
>|||Thank you,
your advise was very helpful.
"Dan Artuso" wrote:

> Hi,
> You want to use Integrated Security, right?
> cnn.ConnectionString = "integrated security=SSPI;data source=" & dbServer
& ";" & _
> "persist security info=False;initial catalog=VPOInventory"
>
> --
> HTH
> --
> Dan Artuso, MVP
>
> "Alan" <Alan@.discussions.microsoft.com> wrote in message news:76566908-5D4
9-4A5E-8F0C-343B91CD0FE2@.microsoft.com...
>
>|||Our SQL server is running in mixed mode and I want to move it to Windows onl
y
mode.
Thank you.
"Preeta" wrote:
> did it help?
> "Alan" wrote:
>|||Thank you - I'm trying to get rid of this account.
First I want to move all our SQL servers to Windows only mode.
Thank you.
"Aaron Weiker" wrote:

> Hello Alan,
> Also, please never use SA in your application. You should create an accoun
t
> for your application to run as and only grant the necessary permissions to
> that user. The same goes for Windows Authentication. Don't grant the user
> you use for running your application membership into the system administra
tors
> role.
> --
> Aaron Weiker
> http://aaronweiker.com/
> http://sqlprogrammer.org/
>
>
>

No comments:

Post a Comment