Unable to get username from token

S

Scott

Hello,

We are receiving errors whey trying to open a SQLConnection to Sql Server
from an ASP.NET web application.

Error Description: Unable to get username from token.
Source: System.Data
Stack Trace: at System.Data.SqlClient.SqlConnection.Open()

This is sporadic - it doesn't happen on every call to Open(). Does anyone
know what this msg is trying to say?

Scott L.
 
W

William Ryan eMVP

Scott:

When you say it's sporadic, does that mean that from the same call it does
it sometimes and doesn't others, or is it indiscriminate among calls, some
consistently work others don't? My first guess is the connection
string...do you use the same connectionstring and is it located centrally
like in Web.Config? If so, then that's definitely a weird problem. If you
have the 'same' string but it's in multiple places, then maybe it's a typo.

Can you post the Connection String - if you are accesssing it multiple
places, let's see each of the ones you use, of more specific, the only used
to call open where this error was generated. Since this is a public NG,
change the server name and password when you post it, leave the username or
tack some letters onto the front of it..if it's a syntax error, this won't
hinder the ability to find the problem but will keep your info secure.

Bill
 
S

Scott

William,

Thanks for the reply. Heres the connection string ..

<add key="ConnectionString"
value="server=sql1;database=db1;Trusted_Connection=Yes;" />

As you can see we're using Win Integrated Auth for our db login. This is
the same string used throughout this part of our application. It's
retrieved from a config file tied to our data access layer assembly. Our
installation of .NET on this webserver has been given a specific Active
Directory userid and password in machine.config. We don't impersonate the
end user at all, we grant access to the application.

The same calls work without error the vast majority of the time, but
occasionally one will fail with this error.

Scott L.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top