用错的中国字

http://reddit.com/goto?id=21135 不知道作者提到NBA球员Martin的“勉族”没有。
阅读更多

Gentle.NET这样用错在那里?

08-02

using System;rnusing Gentle.Common;rnusing Gentle.Framework;rnusing Gentle.Provider.SQLServer;rnusing log4net;rnusing QuickGraph;rnrnrnnamespace GentleExample1rnrn [TableName("Users")]rn public class User : Persistentrn rn private int userId;rn private string userName;rnrn // this is used by clients to construct new usersrn public User( string userName ) : this( 0, userName ) rnrn // this is used by Gentle to reconstruct objects read from the databasern public User( int userId, string userName )rn rn this.userId = userId;rn this.userName = userName;rn rnrn // this is used by client to fetch users from the databasern static public User Retrieve( int userId )rn rn Key key = new Key( typeof(User), true, "Id", userId );rn return Broker.RetrieveInstance( typeof(User), key ) as User;rn rnrn [TableColumn("UserId"), PrimaryKey(AutoGenerated=true)]rn public int Idrn rn get return userId; rn set userId = value; rn rnrn [TableColumn(NotNull=true)]rn public string Namern rn get return userName; rn set userName = value; rn rn rnrn=====================rnusing System;rnusing Gentle.Common;rnusing Gentle.Framework;rnusing Gentle.Provider.SQLServer;rnusing log4net;rnusing QuickGraph;rnrnnamespace GentleExample1rnrn class Class1rn rn [STAThread]rn static void Main(string[] args)rn rn User ford = new User( 10,"Ford Prefect" );rnrn ford.Persist(); // save the new user and assign an id valuernrn User prefect = User.Retrieve( ford.Id ); // retrieve the existing userrn rn rnrn为什么显示ford.Persist(); 出现了异常,rn未处理的“System.ArgumentNullException”类型的异常出现在 mscorlib.dll 中。rnrn其他信息: 键不能为空。rnrn是不是我没有配置文件啊,配置文件怎么设置,文档太少了,真是的,还开源哪!

没有更多推荐了,返回首页