我有以下代码:为什么由Fluent NHibernate生成的模式是只读的?
var schemaExport = new SchemaExport(cfg);
schemaExport.Drop(false, true);
schemaExport.Create(false, true);
Fluently.Configure()
.Database(MsSqlConfiguration
.MsSql2008
.ConnectionString(connString))
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<ProductMap>())
.ExposeConfiguration(CreateSchema)
.BuildConfiguration();
上面的代码创建成功别处定义的两个表,但是当我在做SSMS“编辑前200行”,我发现,细胞是只读的。
在代码文件,映射或其他任何地方没有明显提及任何只读指令。
为什么模式生成为只读?
我在Windows 7 Ultimate x86上使用VS 2010,.NET 4 Client FW,FluentNHibernate 2.0.3.0,NHibernate 4.0.0.4000,Iesi.Collections 4.0.0.4000。
上面的代码是从本书:NHibernate 3 Beginner's Guide [2011]
我不认为这与NH或流利的映射有关。这听起来更像是一个SQL Server/SMSS问题。你有足够的特权来改变数据吗? –
干得好。我已发布我的评论作为答案。如果你喜欢,你可以接受它。 –