I want to add some more tables to my existing cloud database. I selected the SQL Server CE as my database connection type. So it creates the Umbraco.sdf file in App_Data folder. So what can I do for this to add and update new tables?
You'll also want to look into PetaPoco as that is the ORM that is used in Umbraco and you can utilise that to create tables based on classes.
If you take this approach deployments will go through each of your Umbraco Cloud environments when you deploy and it should also work with your local version as well.
I'm trying to connect my Umbraco.sdf file in the cloud. I get the error to open the connection as
System.Data.SqlServerCe.SqlCeException (0x80004005): The database file cannot be found. Check the path to the database. [ Data Source = C:\home\site\wwwroot\App_Data\Umbraco.sdf ]
at System.Data.SqlServerCe.SqlCeConnection.Open(Boolean silent)
But its working good in my local solution. Here is my controller code...
Umbraco Cloud Database Customization
I want to add some more tables to my existing cloud database. I selected the SQL Server CE as my database connection type. So it creates the Umbraco.sdf file in App_Data folder. So what can I do for this to add and update new tables?
Hi Ram,
If you want to deploy Database customisation to Umbraco Cloud, I highly recommend using Migrations.
Although dated, this is a good intro to the concept and I think quite a bit is still valid.
https://cultiv.nl/blog/using-umbraco-migrations-to-deploy-changes/
You'll also want to look into PetaPoco as that is the ORM that is used in Umbraco and you can utilise that to create tables based on classes.
If you take this approach deployments will go through each of your Umbraco Cloud environments when you deploy and it should also work with your local version as well.
Nik
Thank you, Nik. Actually, I'm trying to connect my Umbraco.sdf file with below code.
But i'm unable to open connection with Umbraco.sdf. Can you please suggest some better approch.
Hi Ram!
If you follow the docs on how to work with databases on Umbraco Cloud it should be smooth sailing: https://our.umbraco.com/documentation/Umbraco-Cloud/Databases/#using-custom-tables-with-umbraco-cloud
Hope this helps!
Niels...
Thank you Niels
Hi Niel,
I'm trying to connect my Umbraco.sdf file in the cloud. I get the error to open the connection as
But its working good in my local solution. Here is my controller code...
How can i get the Umbraco.sdf file path in the cloud.
is working on a reply...