If you’re are using SQL Server Developer edition to develop a Silverlight 3 .NET RIA Services Business Application you might encounter an exception during login:

Load operation failed for query ‘Login’.

at System.Web.DomainServices.ReflectionDomainServiceDescriptionProvider.ReflectionDomainOperationEntry.Invoke(DomainService domainService, Object[] parameters)
   at System.Web.DomainServices.DomainOperationEntry.Invoke(DomainService domainService, Object[] parameters, Int32& totalCount)
   at System.Web.DomainServices.DomainService.Query(QueryDescription queryDescription, IEnumerable`1& validationErrors, Int32& totalCount)
   at System.Web.Ria.Services.QueryOperationBehavior`1.QueryOperationInvoker.InvokeCore(Object instance, Object[] inputs, Object[]& outputs)

This is because the providers make use of the connectionstring with the name [LocalSqlServer] from you’re machine.config by default this contains the .\SQLServerExpress instead of MSQLServer, you can change this by editing the web.config:

<connectionStrings>
        <remove name="LocalSqlServer"/>
        <add name="LocalSqlServer"  connectionString="Data Source=.;Initial Catalog=YoureTestDb;Integrated Security=True"    providerName="System.Data.SqlClient"/>
</connectionStrings>

Note:

Make sure the “YoureTestDb” contain the “aspnet_…” authentication tables, by using: C:\Windows\Microsoft.NET\Framework\v2.0.50727>Aspnet_regsql.exe

To install all functionality on a specific database use:
“C:\Windows\Microsoft.NET\Framework\v2.0.50727\Aspnet_regsql.exe” -S MyServer -E -d MyDatabase -A all

If you only want to add membership and roles use:

“C:\Windows\Microsoft.NET\Framework\v2.0.50727\Aspnet_regsql.exe” -S MyServer -E -d MyDatabase -A mr

Don’t forget to do an iisreset

see: http://msdn.microsoft.com/en-us/library/x28wfk74.aspx

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.