简体   繁体   中英

Using Entity Framework Code First to connect to Legacy Oracle Database with devart dotconnect

ERROR: The Type clob is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification.

I have been trying out to use EF 4.1 (code first) with MVC 3, against a legacy Oracle 10g database, using devart dotconnect. The legacy database cannot be changed. I'm trying to read the data in it out to a webpage.

(Devart.Data.Oracle Version: 5.70.140.0)

I've had a few errors to overcome along the way, but came to this one:

error 0040: The Type clob is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification.

This is my code:

Web.config connection info:

<add name="OdeToTrainingCoursesDB"
              connectionString="User Id=test;Password=test;Server=##.#.#.#;
                      Home=OraClient10g;Direct=True; 
                      Sid=dbTest;Persist Security Info=True"
              providerName="Devart.Data.Oracle" />



namespace AllInOne
{
    public class OdeToTrainingCoursesDB : DbContext
    {
        public DbSet<VENUES> VENUES { get; set; }
    }
}



using System.ComponentModel.DataAnnotations;

namespace AllInOne.Models
{
    public class VENUES
    {
        [Key]
        public int VENUE_ID { get; set; }
    }
}

EDIT: Extra info, this is the first table (of many) that I'm trying to read from.

CREATE TABLE VENUES
(
  VENUE_ID    NUMBER(10)                        NOT NULL,
  VENUE_TYP   VARCHAR2(1 BYTE),
  BASE_ORG    NUMBER(10)                        NOT NULL,
  COUNTY      VARCHAR2(35 BYTE)
)

And the MVC Controller throws this

Local = '(model).Local' threw an exception of type 'System.Data.MetadataException'

using System.Web.Mvc;

namespace AllInOne.Controllers
{
    public class VenueController : Controller
    {
        readonly OdeToTrainingCoursesDB _db = new OdeToTrainingCoursesDB();
        public ActionResult Index()
        {
            var model = _db.VENUES;

            return View(model);
        }

    }
}

We have replied to you at our forum .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM