开发者

How do I change a primary key value in SubSonic 3.0?

Is it possible to update a primary key after it's been created in SubSonic 3.0??

Consider this MySql table:

create table items (  
Type varchar(30) NOT NULL,  
Attribute varchar(30) NOT NULL PRIMARY KEY);

And I am trying to edit an item object (so called row)

item i = item.SingleOrDefault(i =>开发者_开发问答; i.Attribute == "123");  
i.Attribute = "234";
i.Save();

The above snippet throws a syntax error MySQLException. After profiling the same, the query that was being executed at back end was this:

UPDATE ITEMS WHERE ATTRIBUTE="123";

Any suggestions/help please.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜