LINQ to SQL的:如何插入记录到一个看法? [英] LINQ to SQL : How to Insert record into a view?

查看:172
本文介绍了LINQ to SQL的:如何插入记录到一个看法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用LINQ to SQL中的数据库操作,我试图在一个视图执行插入操作,它抛出错误,

I'm using Linq to SQL for the Database operations, and am trying to perform insert operations in a VIEW, It throws the Error,

XXt threw exception:  System.InvalidOperationException: Can't perform Create, 
Update or Delete operations on 'Table(XXX)' because it has no primary key.



如何使用LINQ使用C#中插入记录查看?

How to use LINQ to insert a record into View using C#?

感谢。

推荐答案

<击>您不能插入到视图。您只能插入表

您可以做到这一点。 - 见下文

You can do this - see below.

这篇关于LINQ to SQL的:如何插入记录到一个看法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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