MVC3:当我想从控制器访问模型数据时,无法检索模型类的元数据 [英] MVC3:unable to retrieve metadata for my model class when i want to accesse model data from controller

查看:34
本文介绍了MVC3:当我想从控制器访问模型数据时,无法检索模型类的元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 asp.net MVC3 平台的新手,我正在学习发布在 asp.net 网站上的教程:http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/getting-started-with-mvc3-part1-cs

I am new to asp.net MVC3 platform i am following the tutorial which is posted on the asp.net website: http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/getting-started-with-mvc3-part1-cs

但是在我需要从控制器访问我的模型类数据的第五步中,我遇到了一些麻烦,我已经创建了模型类和上下文类,但是当我想使用脚手架模板(控制器使用实体框架进行读/写操作和视图)它给了我如下错误:

But in the fifth step which i need to access my model class data from a controller i am facing some troubles, i have created model class and the context class but when i want to create a controller class using the scaffolding template(controller with read/write actions and views using entity framework) it gives me an error as below:

无法检索我的模型类的全名"的元数据.配置系统初始化失败

unable to retrieve metadata for 'full name of my modelclass'. Configuration system failed to initialize

推荐答案

只需将连接字符串提供程序类型更改为 System.Data.SqlClient

Just change your connection string provider type to System.Data.SqlClient

这篇关于MVC3:当我想从控制器访问模型数据时,无法检索模型类的元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆