M@rkJakes.com

A blog of Mark's musings
  • rss
  • Home
  • Tech Blog
  • Dev Blog
  • Radio Blog
  • Rants
  • Music Interests

Load Operation Failed for query 'GetYourRecords'

The Admin 4/30/2010 10:24:00 PM

One possible solution to this error from Silverlight when you are trying to connect to a datasource could be the lack of permissions of the IIS user to access the database.Just follow these simple steps to solve the problem.  [Source http://codingresource.blogspot.com/2010/01/login-failed-for-user-nt-authorityiusr.html]

1. Open SQL Server Management Studio.
 


 

 
2. On the left menu, expand Security then Logins. Check if 'NT AUTHORITY\IUSR' exists. If not then that is the cause of the problem.
 
 

 


3. Right-click on Logins then click New Login...
 


 


4. On the General page, click Search...
 


 


5. On the next popup window, click Advanced...
 


 

 
6. Then on the following window, click Find Now and find IUSR on the Search Results. Then click OK.
 
 

 


7. Back on the left menu, you'll now see the 'NT AUTHORITY\IUSR' user. Right click on it and click Properties.
 


 



8. On the Server Roles page, check on sysadmin.
 


 

 
9. Then on the User Mapping page check on the database name you need access to; and below that on the database role membership make sure to also check on db_owner then click OK.
 
 

 


...And that's a wrap, you shouldn't be seeing the login failed error now.   
 
[Marks further edit/notes]
 
When I transited to IIS7/Silverlight4/Visual Studio 2010 I kept coming up with this error.
 
It turns out that the application pool is set incorrectly during the installation, or at least, read the following as my method of getting around this error.  I haven't determined the security implications or if there is any detrement in efficiency, but it worked for me...
 
In IIS7, click on the Application Pools and select 'ASP.NET v4.0'
Click on 'Advanced Settings' in the right hand pane
Find the field 'Process Model | Identity '  (By default the identity set is 'ApplicationPoolIdentity')
Click on the button [...] to change the identity
Select 'Built-in Account'
In the drop-down, change the identity from 'ApplicationPoolIdentity' to 'NetworkService'
Click OK a couple of times to save the identity.
 
Next, in the SQL Management Studio, select your database, expand the tree and select Security, then users.
You need to add the Network Service as a valid user, so either right click, add user or select the user if already created.  I will assume here you are creating a user.
 
In 'User Name' type 'NETWORK SERVICE'
In 'Login Name' select the 'NETWORK SERVICE' user, (NT AUTHORITY\NETWORK SERVICE)
Default Schema: dbo
In the Database Role Membership, select 'db_owner'.
Save your changes and run your application.
 
With luck, you will be able to run your application now!
 
 
 




 
Comments
No Comments

Leave a Comment

  • Recent Posts

    • Installing VMWare Tools in Fedora16 (FC16) from scratch
    • DotNet4 without the web installer
    • FreeNAS and iSCSI
    • Using XP as an internet router
    • DCOM Errors on Server
  • Popular Posts

    • UK VHF Aeronautical Radio Frequencies
    • Using the 'OUT' parameter in stored procedures in EF4/Silverlight
    • System.Windows.Ria missing when upgrading from SL3 to SL4
    • Load Operation Failed for query 'GetYourRecords'
    • 99 Ways to improve performance on your (windows) PC
  • Recent Comments

    • The Admin on Using XP as an internet router
    • Dave on Using XP as an internet router
    • Matt on Bidfun.co.uk - Too good to be true!
    • The Admin on Exeter Airport Changes to Flight Waypoints
    • The Admin on Writing objects to files – Serialization
Powered by Graffiti CMS
  • design by jide
  • Theme converted to GraffitiCMS by Adonis Bitar