milosev.com
  • Home
    • List all categories
    • Sitemap
  • Downloads
    • WebSphere
    • Hitachi902
    • Hospital
    • Kryptonite
    • OCR
    • APK
  • About me
    • Gallery
      • Italy2022
      • Côte d'Azur 2024
    • Curriculum vitae
      • Resume
      • Lebenslauf
    • Social networks
      • Facebook
      • Twitter
      • LinkedIn
      • Xing
      • GitHub
      • Google Maps
      • Sports tracker
    • Adventures planning
  1. You are here:  
  2. Home

The type or namespace name 'Schema' does not exist in the namespace 'System.ComponentModel.DataAnnotations' (are you missing an assembly reference?)

Details
Written by: Stanko Milosev
Category: MVC 3
Published: 16 March 2013
Last Updated: 10 October 2013
Hits: 13340

If you are receiving error like in title, then add in the reference :

EntityFramework

Search for:

EntityFramework.dll

In my case it was in folder:

C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Packages\EntityFramework.5.0.0\lib\net40

--

Or you can do it with NuGet. Go to tools -> Library Packager Manager -> Manage NuGet Packages for Solution:

Then search for EntityFramework and install it:

DropDownList - disabled

Details
Written by: Stanko Milosev
Category: MVC 3
Published: 13 January 2013
Last Updated: 13 January 2013
Hits: 6562

If I understand it good, your controller has to look like:

 

public ActionResult Edit(int id)
{
  Partner partner = db.Partners.Find(id);
  ViewBag.Sifra = new SelectList(db.Partners, "Sifra", "Naziv", partner.Sifra);
  return View(partner);
}

view:

@Html.DropDownList("Sifra", null, new { disabled = "disabled"})

AccountController

Details
Written by: Stanko Milosev
Category: MVC 3
Published: 08 January 2013
Last Updated: 04 July 2013
Hits: 5309

If on 

Membership.CreateUser(model.UserName, model.Password, model.Email, null, null, true, null, out createStatus);

You are receiveng messages like:

The user instance login flag is not supported on this version of SQL Server. The connection will be closed. 

or

Unable to connect to SQL Server database.

Then check in your Web.config file:

add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"

 <connectionStrings>
    <add name="ApplicationServices"
         connectionString="Data Source=MyPC;

Connection string name must be same as name of SqlMembershipProvider connection string.

If after you receive error like:

Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'. 

Then in command prompt execute something like:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regsql.exe -S MyServer -U MyUserId -P myPass -A all -d MyDb

And if you receive error like:

Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled' to generate user instances

Then in MS SQL Server execute:

exec sp_configure 'user instances enabled', 1 Reconfigure

and restart server...

Would you like to share your location with...

Details
Written by: Stanko Milosev
Category: MVC 3
Published: 26 December 2012
Last Updated: 11 February 2013
Hits: 5039

If you are receiving similar message, then there is code some part which is trying to determine your location. In my case problem was with Bing maps:

mm.GeoLocationProvider(this.map).getCurrentPosition({

In other cases search for GeoLocation.

  1. There is already an open DataReader associated with this Command which must be closed first.
  2. Writing HTML Helpers
  3. Routing
  4. DbContext

Subcategories

C#

Azure

ASP.NET

JavaScript

Software Development Philosophy

MS SQL

IBM WebSphere MQ

MySQL

Joomla

Delphi

PHP

Windows

Life

Lazarus

Downloads

Android

CSS

Chrome

HTML

Linux

Eclipse

Page 46 of 164

  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50