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 8478545
In Process

The Archive Base Latest Questions

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

I have a server with a SQL Server 2012 Express database. I am authenticated

  • 0

I have a server with a SQL Server 2012 Express database. I am authenticated to connect to it and am using it as the backend for an ASP.NET MVC 4 application.

With this application I’m also developing an API. Calling the API programmatically using jQuery within my own application works fine. Querying the database to get the information works as well.

However, when I run the application from VS2010 and try accessing the API by using a URL that would access the database, I get an HTTP 500 Error.

Just to make sure this issue isn’t on my application’s end, I then modified the API resource so it gets a local array (instead of information from the database) and when I hit the same URL, it returned the information in XML form on the localhost page.

The problem seems to be that the URL call to the API attempts to connect to the database not as the authenticated user (me), but from the browser.

How can I configure SQL Server to allow a URL call to the API in the browser to access the database and return the data in JSON/XML form? (eg. like you can do with the Twitter REST API)

UPDATE:
Debugging output on HTTP Request:

Request URL:http://localhost:5555/api/Performance/ShowMachines

Request Method:GET

Status Code:500 Internal Server Error

Request Headersview source

Accept:text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8

Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3

Accept-Encoding:gzip,deflate,sdch

Accept-Language:en-US,en;q=0.8

Connection:keep-alive

Host:localhost:5555

User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11

Response Headersview source

Cache-Control:private

Connection:Close

Content-Length:0

Date:Thu, 02 Aug 2012 16:40:11 GMT

Server:ASP.NET Development Server/10.0.0.0

X-AspNet-Version:4.0.30319

  • 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-10T18:46:32+00:00Added an answer on June 10, 2026 at 6:46 pm

    I resolved the issue and answered it here:
    C#/ASP.NET – Calling Web API operation via URL? : HTTP Error 500

    The issue was that when I created the .dbml file, and dragged and dropped the table into it, the automatically generated DataContext class created EntitySet objects to represent the foreign-key relationships. I created simple classes with gets sand sets to return the JSON, rather than the classes in the DataContext, excluding the EntitySet objects. As a result, it worked like a charm. Apparently EntitySets are not serializeable, and thus were giving the 500 Error.

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

Sidebar

Related Questions

Using SQL Server 2012 Express. I have a table which represents key/value pairs. keycol
I have downloaded the sample database for SQL Server 2012 Express but I am
We have a web application written with asp.net/c# and uses sql server as SGBD
We have an issue upgrading to SQL Server 2012. I am using the following
I have a SQL Server database which contains date like 2012-01-10 00:00:00.000 When I
I have a SQL Server 2012 database with filestream enabled. However, when I backup
We have a WinForms project that requires SQL Server 2008 R2 Express. The application
Im using SQL Server 2012 and I have a case where I have to
I have a ms sql 2012 server and I use this function to add/records:
I am using entity framework 4.3.1 against a sql server 2012 database and I

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.