Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.NET app won't communicate with SQL

Status
Not open for further replies.

JackelBarrett

IS-IT--Management
Mar 29, 2001
12
US
I am a new .Net / SQL developer, I am just learning.

Here is the problem:

We are building a web app and having
it authenticate across servers via AD. One machine is SQL, the other
is the App Server. They are all on the same domain.

Basically, our web app works fine if IIS and the SQL server are on the
same box, but if we have them on different server, we get an error
that shows

"Not associated with a trusted SQL Server connection".



--The authentication for both an application and the server is
"Windows" authentication
--In the web application, it specifies the <authentication mode =
"Windows" /> in the Web.config file
--Connection is via the connection string:
"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
Info=False;Initial Catalog=TEST;Data Source=Rxxxxxxx;Use Procedure for
Prepare=1;Auto Translate=True;Packet Size=4096;Workstation
ID=Rxxxxxxx;Use Encryption for Data=False;Tag with column collation
when possible=False"
--All users are added to the database

It works in case:
When the web application and the database are on the same machine (SQL
server). In this case, any user can access the database via the web
application.

It works in case:
If the web application is on the development machine and the database
is on the SQL server (on the different machine). In this case, you
have to logon on the development machine to run the web application
and access the data.

It does not work:
If the web application is on the development machine and the database
is on the SQL server (on the different machine). If the user is logged
on the different machine, the user can bring up the web application
(which is located on the development machine), but the
SqlConnection.Open() fails for the '(null)' user.

Any thoughts?
 
Sounds like you need to create a user on the SQLServer that has permissions to "touch" the tables in the Rxxxxxxx database. Then use those credentials in your connection string. That's a pretty standard way of doing things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top