Re: Using Widows Authentication and accesssing SQL with SQL Authentication
- From: "Valar" <vmanickamus@xxxxxxxxx>
- Date: 6 Mar 2006 10:47:31 -0800
Hi David,
Thanks for your reply.
I am providing SQL authentication in my connection string.
followed the following link to specify the connection string.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000010.asp
When I further dug thorugh the problem, I tried to work with a test
web site and as I debuggged the first inner exception is
'conn.ServerVersion' threw an exception of type
'System.InvalidOperationException' and the conn state is closed., Then
on the conn.open() statement the next login fails exception is thrown.
I could connect to the database with the same userID and pwd specified
in the connection string through VS studic 2005. I would appriciate any
help to solve this problem
Thanks,
Valar
David Browne wrote:
"Valar" <vmanickamus@xxxxxxxxx> wrote in message
news:1141433865.402206.290660@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi
I am working on an application with .NET 2005 and SQL server 2000.
I am using windows authentication for my web application authentication
and trying to connect to the SQL server with SQL authentication
credentials.
My web.config reads as follows:
web application Authentication:
<authentication mode="Windows" />
<authorization>
<allow users="*" />
<!-- Allow all users -->
<!-- <allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
<deny users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
-->
</authorization>
<identity impersonate="true" />
SQL Authentication:
<connectionStrings>
<add name="DevDBConnection"
connectionString="Server=MyServer;database=MyDB;uid=MyUser;pwd=MyPwd;"
providerName="System.Data.SqlClient" />
</connectionStrings>
MY IIS directory security is set to "Integrated Windows
authentication". I am validating the user againt the Active Directory
for authentication and reading the user details and groups which works
fine.
But trying to open a connection object fails. I am getting a
"{"Cannot open database requested in login 'MyDB'. Login
fails.\r\nLogin failed for user 'MyUser'."}"
I have tried searching for a solution to my best, but could not solve
this problem.
Nothing magic here. If your connection string specifies SQL authentication,
it will use the user name and password you provide. Can you connect to that
SQL Server using that user name and password with Enterprise Manager or
Visual Studio?
David
.
- References:
- Prev by Date: Re: login routine with information returned from database
- Next by Date: Re: Could someone answer a stupid dgv question?
- Previous by thread: Re: Using Widows Authentication and accesssing SQL with SQL Authentication
- Next by thread: Re: Using Widows Authentication and accesssing SQL with SQL Authentication
- Index(es):
Relevant Pages
|
|