0

I have the following code:

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();

The above code successfully creates the two tables defined elsewhere, but when I do "Edit top 200 rows" in SSMS, I find that the cells are read-only.

There is no obvious mention of any read-only directive in the code files, mappings, or anywhere else.

Why is the schema generated as read-only?

I am using VS 2010, .NET 4 Client FW, FluentNHibernate 2.0.3.0, NHibernate 4.0.0.4000, Iesi.Collections 4.0.0.4000, on Windows 7 Ultimate x86.

The above code is from this book: NHibernate 3 Beginner's Guide [2011]

Sabuncu
  • 5,095
  • 5
  • 55
  • 89

1 Answers1

1

I don't think this is related to NH or the fluent mappings. It sounds more like a SQL Server/SMSS issue. Have you got enough privilege to alter the data?

David Osborne
  • 6,436
  • 1
  • 21
  • 35
  • Thank you, your answer clued me to the actual problem. I was trying to edit an identity column! – Sabuncu Feb 09 '17 at 17:40