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

  • Home
  • SEARCH
  • 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 8873659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:31:11+00:00 2026-06-14T18:31:11+00:00

I am working on vs 2010 and EF 4.1 with SQL server database .

  • 0

I am working on vs 2010 and EF 4.1 with SQL server database.
Below mentioned code works fine with local SQL server DB.(SQL 2008).

But when I published the MVC application for windows AZURE cloud and SQL Azure it’s giving below mentioned error.

  1. Why this error is only return SQL Azure (working with desktop SQL server 2008)?
  2. How to get rid of this ?

My repository code sample as below.Below mentioned error comes when calling
Catalog.SaveChanges() method.

using (var catalog = new DataCatalog())
{
    var retailSaleReturn = new RetailSaleReturn
    {
        ReturnQuantity = returnQuantity,
        Product = saleDetailObj.Product,
        Owner = owner,
        Provider = provider,
    };

    //add to context
    Catalog.RetailSaleReturns.Add(retailSaleReturn);

    //save for db
    Catalog.SaveChanges();
}

DbUpdateException is Like below :

{"An error occurred while saving entities that do not expose foreign key properties for their relationships. The EntityEntries property will return null because a single entity cannot be identified as the source of the exception. Handling of exceptions while saving can be made easier by exposing foreign key properties in your entity types. See the InnerException for details."}

InnerException is Like below :

{"Tables without a clustered index are not supported in this version of SQL Server. Please create a clustered index and try again."}

StackTrace is Like below

at System.Data.Entity.Internal.InternalContext.SaveChanges()
   at PawLoyalty.Data.Repositories.CustomersRepository.ReturnRetailOnlySales(Guid saleDetailId, Int32 returnQuantity, String providerKey, String ownerKey) in D:\PawLoyalty Module\PawLoyalty\PawLoyalty\PawLoyalty.Data\Repositories\CustomersRepository.cs:line 550
   at PawLoyalty.Web.Areas.Providers.Controllers.CustomersController.ReturnRetailOnlySales(String providerKey, String ownerKey, String petKey, Guid saleDetailId, Int32 returnQuantity) in D:\PawLoyalty Module\PawLoyalty\PawLoyalty\PawLoyalty.Web\Areas\Providers\Controllers\CustomersController.cs:line 942
   at lambda_method(Closure , ControllerBase , Object[] )
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a()
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
  • 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-06-14T18:31:12+00:00Added an answer on June 14, 2026 at 6:31 pm

    You need to create a clustered index on all tables in SQL Azure that you wish to add rows to; otherwise the insert statement always fails.

    CREATE UNIQUE CLUSTERED INDEX Idx_TableName ON TableName(yourGUIDColumn);

    Here is a reference to the general guidelines and limitations specifically regarding these indexes: MSDN Link

    Here is another article which explains the reasoning behind this: link

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Whilst working on a SQL Server 2008 database project in Visual Studio 2010 I
The project I'm working on creates a local copy of the SQL Server database
Ii have a database (sql server 2008) and I am working with c# in
This code was once working on sql server 2005. Now isolated in a visual
I am working on saving twitter search results into a database (SQL Server) and
I am working on a sql database project in VS 2010. I know how
I had a local database used to connect with sql server authentication, every thing
I am working on visual studio 2010 and i have a database in Server
Using Visual Studio 2010 SP1, SQL server 2008: Motherboard recently failed and I migrated
We've been working with .Net v3.5 SP1 and MVC 2. Backend SQL Server 2005.

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.