配置系统无法初始化实体框架错误 [英] configuration system failed to initialize entity faramework error

查看:132
本文介绍了配置系统无法初始化实体框架错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

i我正在尝试学习实体framewrok,所以我去了第一个例子,但我遇到了一个错误

hello,
i am trying to learn entity framewrok, so i go to first example, but i faced an error

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Objects;
using System.Data.EntityClient;
using System.Data.Entity;
using System.ComponentModel;


namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                using (Entities ctx = new Entities())
                {
                    var OracLinq = from e in ctx.AM_GI_COUNTRIES
                                   where e.PK_CODE == 42
                                   select e;
                    Console.WriteLine("LINQ to Entites Result");

                    foreach (var result in OracLinq)
                    {
                        Console.WriteLine("COD:" + result.PK_CODE);
                    }

                    Console.WriteLine();
                    Console.ReadLine();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message.ToString());
            }
        }
    }
}



我添加了DataModel

代码试图执行using(Entities ctx = new Entities())错误发生异常:配置系统初始化失败

我错过了什么吗?

i有:

windows 7 64bit

visual studio 2010

oracle cilent 12g


after i added the DataModel
when the code trying to execute "using (Entities ctx = new Entities())" error happen with exception: configuration system failed to initialize
do i miss something?
i have:
windows 7 64bit
visual studio 2010
oracle cilent 12g

推荐答案

您的数据模型类设置不正确或app.config文件有问题,通常是连接字符串。但是,既然你没有提供任何这些东西,那么任何人都不可能告诉你什么是错的。
Either your data model classes are not setup correctly or the app.config file has a problem, usually with the connection string. But, since you didn't provide any of that stuff, it's impossible for anyone to tell you what's wrong.


这篇关于配置系统无法初始化实体框架错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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