asp.net mvc的LINQ SQL的问题 [英] asp.net mvc linq sql problem

查看:179
本文介绍了asp.net mvc的LINQ SQL的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用asp.net MVC 2和LINQ to SQL的一个项目。试图将数据插入到其中表具有TINYINT的身份列类型表时出现问题。当试图插入出现下列错误:

I am working on a project using asp.net mvc 2 and linq to sql. The problem occurs when trying to insert data into a table where the table has an identity column type of tinyint. When trying to insert the following error occurs:

The primary key column of type 'TinyInt' cannot be generated by the server.

是否LINQ to SQL的支持TINYINT数据类型?

Does linq to sql support tinyint datatype?

请帮我

推荐答案

从我已经能够收集,LINQ to SQL的不支持TINYINT自动递增字段。

From what I have been able to gather, Linq To Sql doesn't support TinyInt for auto increment fields.

您可以更改的数据类型为SMALLINT或INT?

Can you change the datatype to smallint or int?

请参阅<一以下螺纹href=\"http://connect.microsoft.com/VisualStudio/feedback/details/402060/accessing-a-primary-key-id-when-its-declared-as-a-tinyint-using-linq\"相对=nofollow>微软连接:

当你有一个表标识
  TINYINT的领域,它被设置为自动
  增量,则不能添加新记录
  该表。 LINQ说,主要的
  类型'TINYINT'的键列不能
  由服务器'中产生

When you have a table with an identity field of tinyint and it's set to auto increment, you can't add a new record to that table. LINQ says, 'The primary key column of type 'TinyInt' cannot be generated by the server'

感谢您抽出时间来发送
  这种反馈和bug报告。我们有
  审查了这个问题并确认
  的行为,但我们不会被修复
  这在LINQ的下一版本
  SQL。

Thank you for taking the time to send this feedback and bug report. We have reviewed the issue and confirmed the behavior, but we will not be fixing this in the next release of LINQ to SQL.

这篇关于asp.net mvc的LINQ SQL的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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