实体数据模型错误 [英] entity data models error
问题描述
我是这个话题的新手!
我已经编写了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屋!