Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have problem When I add parameters in oracle database, with mvc project


this is error
https://i.stack.imgur.com/LDhpQ.png


GEolab class
C#
    namespace WebApplication4.Models
{
    using System;
    using System.Collections.Generic;

    public partial class GEOLAB
    {
        public int GEOLAB_ID { get; set; }
        public string GEOLAB_NAME { get; set; }
        public string GEOLAB_JISHI { get; set; }
        public  int GEOLAB_ASAKI { get; set; }
    }
}


entity class

C#
public partial class Entities11 : DbContext
{
    public Entities11()
        : base("name=Entities11")
    {
    }

    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
        throw new UnintentionalCodeFirstException();
    }

    public DbSet<GEOLAB> GEOLABs { get; set; }
}


connectionstring
C#
<add name="Entities11" connectionString="metadata=res://*/Models.EasyDocDB.csdl|res://*/Models.EasyDocDB.ssdl|res://*/Models.EasyDocDB.msl;provider=Oracle.DataAccess.Client;provider connection string="DATA SOURCE=XXX;PASSWORD=XXX;PERSIST SECURITY INFO=True;USER ID=XXX"" providerName="System.Data.EntityClient" />



homecontrollers

C#
using System.Data.OracleClient;
using System.Data.Entity;
using WebApplication4.Models;
using WebApplication4.Controllers;


namespace WebApplication4.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/
        public ActionResult Index()
        {
            
          
            return View();

        }
        public ActionResult list(string name, string jishi, int asaki)
        {
            Entities11 db = new Entities11();
            GEOLAB dg = new GEOLAB()
            {
                GEOLAB_NAME=name,
                GEOLAB_JISHI=jishi,
                GEOLAB_ASAKI=asaki

            };

            db.GEOLABs.Add(dg);
            db.SaveChanges();
            return View();
        }
	}
}



this is error

An exception of type 'System.ArgumentException' occurred in System.Data.Entity.dll but was not handled in user code

Additional information: The specified store provider cannot be found in the configuration, or is not valid.


What I have tried:

a tried change webconfig connectionstrings
Posted
Updated 5-Oct-17 13:21pm

1 solution

Try to replace
XML
<add name="Entities11" connectionString="metadata=res://*/Models.EasyDocDB.csdl|res://*/Models.EasyDocDB.ssdl|res://*/Models.EasyDocDB.msl;provider=Oracle.DataAccess.Client;provider connection string="DATA SOURCE=XXX;PASSWORD=XXX;PERSIST SECURITY INFO=True;USER ID=XXX"" providerName="System.Data.EntityClient" />

with
XML
<add name="Entities11" connectionString="metadata=res://*/Models.EasyDocDB.csdl|res://*/Models.EasyDocDB.ssdl|res://*/Models.EasyDocDB.msl;provider=Oracle.DataAccess.Client;provider connection string="DATA SOURCE=XXX;PASSWORD=XXX;PERSIST SECURITY INFO=True;USER ID=XXX" providerName="System.Data.EntityClient" />
 
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