Click here to Skip to main content
15,896,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
hello,
i am trying to learn entity framewrok, so i go to first example, but i faced an error
C#
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());
            }
        }
    }
}

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
Posted
Comments
Kornfeld Eliyahu Peter 1-Dec-13 10:01am    
What Entities are?

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900