How to fill prepopulated tables while installing database or upgrading

Mar 10, 2010 at 11:01 AM

Hi,

I have some table in my application which need to be created with data in it when i install using our installation project.

lets say we have country i have populate all the countries in static data option in model. when we install this project table is created but there is no data in that table.

 

how can i do that when i install a project it populate with the values of the countries.

 

Thanks in Advance

Jayesh

Mar 10, 2010 at 12:06 PM

I'm a beginner in NHydrate but this could be achieved by using Static Data  for tables (search "static data" in Nhydrate  Book.doc).

Mar 10, 2010 at 12:16 PM

Thanks for your reply however it use to create ENum not to create country table with populated value ID,STDCODE and Country name three field

Thanks in Advance

Jayesh

Coordinator
Mar 11, 2010 at 7:03 PM

I do not understand what is wrong. Are you using the static data functionality but it is NOT populating? If not is there some reason you are not using the static data. An enumeration is only created if the table is marked as a type table. For all normal tables the static data is just inserted.

Mar 12, 2010 at 4:29 AM
Edited Mar 12, 2010 at 5:08 AM

Thanks for making me clear about Enum and static data, however i tried to populate 214 items of country table and when i generate code and install database it does not insert that 214 static data. I have checked in static data properties it shows 214 items in that property but not in database.

Please help me how to populate values from model.

Thanks,

Jayesh

Coordinator
Mar 12, 2010 at 4:51 PM

Please look at the CreateSchema.sql file. Do you see the data? If not please forward your model to chrisd@nhydrate.org.