ash*_*raz 5 c# linq sql-server asp.net linq-to-sql
表:UserTypes
领域:row,name,Type
此代码无效:
Int64 row = 1;
var myType = (from b in dc.UserTypes where b.Row == user.Row select b).Single();
myType.Type = "personalPage";
dc.SubmitChanges();
Run Code Online (Sandbox Code Playgroud)
但是,这段代码确实......
dc.ExecuteQuery<UserType >("update dbo.UserType set Type='personalPage' where row={0}",user.Row);
我收到此错误:
键入单词是一个单词reserved.i不能用户单词
Type
编辑
DBML
[Table(Name="dbo.UserType")]
public partial class UserType
{
private long _Row;
private string _Type;
public UserType()
{
}
[Column(Storage="_Row", DbType="BigInt NOT NULL")]
public long Row
{
get
{
return this._Row;
}
set
{
if ((this._Row != value))
{
this._Row = value;
}
}
}
[Column(Storage="_Type", DbType="NVarChar(500) NOT NULL", CanBeNull=false)]
public string Type
{
get
{
return this._Type;
}
set
{
if ((this._Type != value))
{
this._Type = value;
}
}
}
}
Run Code Online (Sandbox Code Playgroud)