Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6920373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:08:18+00:00 2026-05-27T10:08:18+00:00

I have a simple WCF project that uses the Entity Framework to access the

  • 0

I have a simple WCF project that uses the Entity Framework to access the AdventureWorks database. Its actually out of a book Windows Communication Foundation 4: Step by Step.

The catch is that the SQL Server database is not a local SQL Server Express instance but a full SQL Server 2008 R2 instance on an external machine called win01s305. I created a Data Model from the external Database by Generate from Database. The data access works fully with the built-in ASP.NET Web Server (Cassini?) until I publish the WCF service to IIS. Then the credentials/account are different on the remote SQL server machine and the data access stops working.

The book specifies a script if you have trouble:

USE [AdventureWorks]
GO
CREATE USER [IIS APPPOOL\DefaultAppPool] FOR LOGIN [IIS APPPOOL\DefaultAppPool]
GO
EXEC sp_addrolemember N'db_owner', [IIS APPPOOL\DefaultAppPool]
GO
GO
CREATE USER [IIS APPPOOL\ASP.NET v4.0] FOR LOGIN [IIS APPPOOL\ASP.NET v4.0]
GO
EXEC sp_addrolemember N'db_owner', [IIS APPPOOL\ASP.NET v4.0]
GO

The issue is these accounts do NOT exist on the remote SQL Server machine. The machine does not have IIS or the .NET Framework on it, just SQL Server. How can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:08:19+00:00Added an answer on May 27, 2026 at 10:08 am

    You either have to run your app pool under a domain account and give that user rights in your database or, with mixed mode authentication turned on on the sql server, create an SQL authenticated user and put it’s name and password in your connection string.

    USE [master]
    GO
    CREATE LOGIN [MYDOMAIN\MyAccount] FROM WINDOWS WITH DEFAULT_DATABASE=[master]
    GO
    USE [MyDatabase]
    GO
    CREATE USER [MyDomain\MyAccount] FOR LOGIN [MyDomain\MyAccount]
    GO
    USE [MyDatabase]
    GO
    EXEC sp_addrolemember N'db_datareader', N'MyDomain\MyAccount'
    GO
    USE [MyDatabase]
    GO
    EXEC sp_addrolemember N'db_datawriter', N'MyDomain\MyAccount'
    GO
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a WCF service that uses Entity Framework to query a SQL database.
I have a VS project used for my .NET WCF host with some simple
I have written a simple WCF service that accepts and stores messages. It works
I have written a very simple WCF service, that worked fine (code below), then
i have a simple xml file in a wcf service that i am trying
I just start a project where I need to have a WCF services that
I have an Excel VSTO workbook project. The excel workbook uses windows service WCF
I have a simple WCF service (hosted as its own site in IIS). It
I have been developing a WCF project that will expose web services (HTTP-based) that
This is real simple. I have a wcf service (nothing fancy, just New Project->

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.