.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Unable to access Entity in controller

Posted By:      Posted Date: September 04, 2010    Points: 0   Category :ASP.Net
 Problem is that when i do like :- Right-click the Models directory and select Add?New Item?Data?ADO.NET Entity Data Model. then generatemodel from a database, it creates OopsData.edmx. and creates entity named OopsEntity. When i try to access this entity in Homecontroller it gives me error like broken reference something. But if i do same thing by right -clicking the project (solution explorer) then i am able to access OopsEntity in HomeController. Reason for asking that is coz i was following the MVC Music Store tut and in it, its done by creating OopsData.edmx in model folder but in my case its not working. Other question is that what is that difference between creating same thing by right clicking on (using) model or solution explorer (project). 

View Complete Post

More Related Resource Links

unable to access control inside webuser control



I have used calender web user control inside my project where i took textbox,button and calender.....but after dragging onto my aspx page....i am unable to access this textbox,calender and button on aspx page...Pls help me to find out the solution.

Data Points: Deny Table Access to the Entity Framework Without Causing a Mutiny


Julie Lerman shows database administrators how to limit access to databases from the Entity Framework by allowing it to work only with views and stored procedures instead of tables-without impacting application code or alienating developers.

Julie Lerman

MSDN Magazine August 2010

SOA Data Access: Flexible Data Access With LINQ To SQL And The Entity Framework


Building a data access layer using LINQ to SQL and the ADO.NET Entity Framework allows you to decouple your application from the persistence technology you're using.

Anthony Sneed

MSDN Magazine December 2008

RowDataBound how to access to the associated entity


Hi, i use a generic list of object to bind a GridView

In the RowDataBound event i need to access to the entity associated to the row and not only to the single property using
DataBinder.Eval(e.Row.DataItem, "propertyname")

WCF Service Unable to Access Personal Certificate Store Unless Service Account is Logged In

I created a WCF service that has a method which makes a call to a SOAP web service over the internet. In order to make a call to the SOAP web service, it requires that an X.509 certificate be sent with the HttpWebRequest. The X.509 certificates are loaded in the Personal and Trusted Certificate store of the account which the service is running under. When the service account is logged into the server, everything works just fine. However, when the service account is not physically logged onto the server, it has problems loading up the X.509 certificate and fails authentication when trying to make the HttpWebRequest. I am new to WCF services so I don't even know where to start looking. Can anyone please help? Thanks in advance.

Custom Entity Framework template and access to the database type

First and foremost ... I already made a few changes in the template, the most important one changing the methods generated for stored procedures with OUTPUT parameters and no resultset so that instead of instantiating a few OutputParameter objects, passing them to the method and extracting the values (all without any type checking) you just call the method with a few "out someType?" parameters so I do not need the very basics. I am totally confused by all those GlobalItem, EdmProperty, BuiltInTypeKind, TypeUsage and all this made of objects, all alike and all different though so as soon as I need more data than what's already used by the template I run into problems :-(What I would like is to change the WritePrimitiveTypeProperty() so that it outputs [StringLength(xxx)]  for all char, varchar, nchar and nvarchar properties. But I can't find a way to get from an EdmProperty in the model to the database type in the store.Can anyone help me?In case anyone is interested here's the modified stored procedure mapping code for the template. The first code replaces the original in the .tt: //////// //////// Write EntityContainer and ObjectContext Function Import methods. //////// region.Begin(GetResourceString("Template_RegionFunctionImports")); foreach (EdmFunction edmFunction in container.FunctionIm

Unable to access VM network drive in SQL during backup generated by stored procedure

I get the following error in a log file created in the osql command: Msg 3201, Level 16, State 1, Server KAC2KGS2, Procedure usp_Kaman_Full_SqlDB_Backup, Line 150Cannot open backup device 'x:\Servername_master_sqlbu_200703101930.bkf'.Device error or device off-line. See the SQL Server error log for moredetails.Msg 3013, Level 16, State 1, Server KAC2KGS2, Procedure usp_Kaman_Full_SqlDB_Backup, Line 150BACKUP DATABASE is terminating abnormally. The device is established in a CMD file right before the osql command is started that starts my stored procedure.  The CMD in this file is: for /f "tokens=15 delims=." %%i in ('ipconfig^|find "IP Address"^|find "192.168"') do set SUBNET=%%i :loopif exist x:\ net use x: /delnet use x: \\192.168.%SUBNET%.1\backup if not ERRORLEVEL 1 ( goto continue) else ( echo FAILED TO CONNECT TO BACKUP SERVER >> "%SystemDrive%\LogFiles\%Computername%.log" sleep 60 goto loop) :continue echo IP ADDRESS OBTAINED Echo delete old log file if it exists if exist %3\%computername%_kaman_full_sqldb_backup_old.log del /Q %3\%computername%_kaman_full_sqldb_backup_old.log Echo Rename log file to old.log rename %3\%computername%_kaman_full_sqldb_backup.log %computername%_kaman_full_sqldb_backup_old.log echo backup SQL Databases on server will start now osql -E -n -d %1 -i %2\kaman_full_sqldb_backup.sql -h-1 -o %3\%Co

Unable to access Configure Service Accounts using the Farm acount

hi all, I am new to SharePoint and have started working directly on SP2010,   I installed SP 2010 using the Domain\spadmin account. I have also added mine domain account as the administrator in the central admin(farm administrator) now m trying to start the SharePoint Server Search 14 service from "services.msc" for which the log in as user is mine domain account, for which i am getting the following error: The SharePoint Server Search 14 service failed to start due to the following error: The service did not start due to a logon failure. if I check for all the services which are running in SharePoint I get that SharePoint Search service is active. also when i try to access Central Admin --> Security --> Configure Service accounts then I get the error message as access denied signin as different user.   Please help me out as i need to configure search for my application and m not having the access.   Thanks for the help Arun Kumar

Unable to access sub site from all farm WFEs

I know there is probably a simple explanation for this, but so far I've not found it.  I'm simply creating a new site collection (sites/subsite) for the default port 80 web application and am able to access it from wfe1, but not from other wfes in the farm. So, the default site collection (/) is already there and can be accessed from any WFE in the farm (i.e. http://wfe1/ http://wfe2, etc..)  No I go to create a new site collection and am using the following URL http://wfe1/sites/subsite.  From WFE1 I can access the new site no problem. But, if I try and go through wfe2, etc. (http://wfe2/sites/subsite), I get an immediate HTTP 404 Not Found error.  I've tried adding alternate access mapping for each wfe in the farm and that seems to work, but doesn't that essentially mean that all request are answered by wfe1? This was not the default behavior in SP7.  What has changed?

Web Service Unable to access Directory (Temporary ASP.NET Files) CS0016

QuestionMoving web service to a production level server. This is not a new server, but is new to running an ASP.NET 2.0 web service. No other websites or services existed on this server.

Installed .Net 2 and specified that ASP is registered for 2.0 using aspnet_regiis. Installed missing components such as Front page extensions. When I try to browse to the services asmx page I get the error saying that the process has a compilation error and cannot access the asp.net temp directory under the 2.0 Framework. I looked at the directory and it appears that the asp.net process and others have correct access.

Note a basic asp.net page will come up as well as a basic html page.

All comments are welcome.

  • .Net 2
  • ASP.NET aspnet_regiis specifies .Net 2 as root
  • C#
  • IIS6
  • Windows Server 2003 SP1

Access database with help of entity


Hello Everyone,

     I am slightly new to this part of .Net and I will need your help.

 There is a framework in Java known as JPA/Hibernate which uses classes to map tables of databases. I want to know can we achieve the same result in .Net. I think that is possible through ORM but I am not very much sure how to use it.

Can anyone please explain me with an example.

Thanks in advance

Service Broker Queue message activates stored Proc as SA but the stored proc is unable to access oth


I have a queue whose activation I defined as below

ALTER QUEUE SomeInitiatorQueue
PROCEDURE_NAME = usp_SomeProc,

Now I am trying to access another database in usp_SomeProc as below

Select SomeColumn SomeOtherDb.dbo.SomeTable

Here I am getting this error "The server principal "sa" is not able to access the database "SomeOtherDb" under the current security context."

It never allows unless I grant all permissions on the database to all.

what is the solution?

Unable to access files on web server, going crazy!


I have a computer running visual web developer express 2008 that does not access most files on my web server. The file tree is there but when I try to open a file "unable to get file ----- from the web server" appears. I have uninstalled, cleaned, searched for answers but am not able to fix the issue. This happened 4 days ago. Other computers running same software can access the files. Linux RH-Ent web server (if it matters) Any help appreciated.

Report Builder 3.0 unable to access SharePoint Foundation 2010 Report Server


I am having a terrrible time getting this to work. I have configured the SharePoint site and the SQL Servers involved to use Kerberos. That has been confirmed working.

I then configured the SharePoint site's Reporting Services integration (trusted account), enabled anonymous access and enabled report builder. I can launch report builder without any issues at all. The problem comes when I try to save my report. When Report Builder is started Items->New-ReportBuilder Report it opens and display in the lower left hand corner "No current report server." When I close the Wizard dialog and click connect I enter http://server.fqdn.net and I receive the following error:

Connection failed:

Unable to connect to the server that is specified in the URL, 'http://servername.fqdn.net/'.

Make sure that the server is running, the URL is correct, and you have permission to use the server.

I have also tried http://servername.fqdn.net/reportsserver/. When I try that I receive a login prompt. When I enter my credentials it tries for a few seconds and then sends another login prompt. I installed the report server using default settings. The reporting services db is on the same server as sharepoint. The configuration and other databases are on a remote S

Reporting Service Integration, Unable to access Reporting Services Site Settings


I am attempting to get reporting services running in integrated mode with sharepoint 2010. I have everything installed and features turned on. In the site collection, when I click on  Site Settings > Reporting Services Site Settings, I am presented with:

Error: The request failed with HTTP status 401: Unauthorized.


I get virtually zero hits when searching for this. Any help is appreciated.


Access Services is unable to process the request.


When I publsih a web database template from the Microsoft application I get the following error:

Access Services is unable to process the request.Click here to try again.

Larry Stupka

Access Services is unable to process the request.Click here to try again.


I have published an Access Web Database that is one of the templates for microsoft and I get the following error:

Access Services is unable to process the request.  Click here to try again.

Larry Stupka
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend