Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Access to the same database from C# and ASP.NET

Status
Not open for further replies.

north2012

Member level 3
Joined
Apr 1, 2013
Messages
63
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,813
I am using Microsoft Visual Studio 2013 Ultimate.

I have one C# application connected with WSN to collect and save all sensor readings in database. It is working fine and stable.

Later I decided to add ASP.NET application (developed in the same software) so other computers in LAN can access my page and check measurements. I have one web form with few labels and buttons to ensure move forward and backward through the database table. It is working fine.

The problem is that I can not access in the same time to the database from C# application and web application deployed on the server. For example, if I start C# app before web it is OK and I can use it to collect new data but if I try to access in the same time from web I have error in browser:

Cannot open database "C:\USERS\USER\DOCUMENTS\VISUAL STUDIO 2013\PROJECTS\HOME SENSOR DATABASE\HOME SENSOR DATABASE\HOME SENSOR.MDF" requested by the login. The login failed. Login failed for user 'NT AUTHORITY\SYSTEM

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Cannot open database "C:\USERS\USER\DOCUMENTS\VISUAL STUDIO 2013\PROJECTS\HOME SENSOR DATABASE\HOME SENSOR DATABASE\HOME SENSOR.MDF" requested by the login. The login failed. Login failed for user 'NT AUTHORITY\SYSTEM'

Can you recognize what is the problem?

Thanks.
 

Depending on a variety of variables, such as your server operating system, your hardware resources, and your site's performance requirements, you can configure your environment to support physically separate or logically separate servers
 

Thank you very much for your reply. Can you please be more specific? I have to restart my project or I can change project settings? C# application should have permission to read/write/delete data while ASP.NET should have read-only access.

Thanks.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top