使用ado.net EF将对象添加到表中时引发错误Visual Studio ArgumentException

时间:2014-08-15 18:16:35

标签: c# entity-framework visual-studio-2012

所以我使用Visual Studio连接到本地oracle db,我之前从转储文件导入。我可以看到表中记录的值就好了。但是当我尝试创建一个对象并将其添加回表中时,我在system.data.entity.dll中发生了参数异常。附加信息:初始化字符串的格式不符合从索引118开始的规范。我曾经环顾四周,无法找到我的案例的解决方案....这是连接问题还是?

public partial class Form1 : Form
    {
        static SPEntities SPContext = new SPEntities;
        public Form1()
        {
            InitializeComponent();
            runTest();
        }            
        void runTest()
        {
            ORI newOrObject = new ORI();
            newOrObject.ORIID = 15852;

            SPContext.ORIs.Add(newOrObject);
            SPContext.SaveChanges();

        }
    }

错误

An unhandled exception of type 'System.ArgumentException' occurred in System.Data.Entity.dll

Additional information: Format of the initialization string does not conform to specification starting at index 118.

0 个答案:

没有答案
相关问题