实体数据模型错误 [英] entity data models error

查看:96
本文介绍了实体数据模型错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生!....

我是这个话题的新手!

我已经编写了edms的代码,但它给出了例外.....



有2个文件program.cs:

使用System;

使用System.Collections.Generic;

使用System.Linq;

使用System.Data.Entity;

使用System.Data;

使用System.Data.SqlClient;

使用System.Text;

使用BusinessObjects;



namespace EntityFramework_demo

{

class program

{

public static void test_App()

{

certificationEntities cer = new certificationEntities();

Emp em = new Emp();

em.ID = 3;

em.Name =niitin;

em.Age = 23;

cer.AddObject(nitin,em);

cer.SaveChanges();

控制台。写(数据保存成功);

}











static void Main(string [] args)

{

test_App();

}

}

}



但它是例外:

无法找到EntitySet名称'certificationEntities.nitin'。

解决方案

sir !....
I'm new to the this topic!
ihave written the code for edms but it is giving exception.....

there are 2 files program.cs :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Entity;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using BusinessObjects;

namespace EntityFramework_demo
{
class Program
{
public static void test_App()
{
certificationEntities cer = new certificationEntities();
Emp em = new Emp();
em.ID = 3;
em.Name = "niitin";
em.Age = 23;
cer.AddObject("nitin",em);
cer.SaveChanges();
Console.Write("data saved successfully");
}





static void Main(string[] args)
{
test_App();
}
}
}

But it is giving exception :
The EntitySet name 'certificationEntities.nitin' could not be found.

解决方案

这篇关于实体数据模型错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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