This was one of the most clear and working Blazor Server CRUD tutorials I"ve seen. I followed along end-to-end, while updating some terminology from Posts to my data set. And all was working as you showed (as expected :)) Some questions: - how to ask for a confirmation before updating or deleting a record? - can I migrate SQL Server DB to SQLite (my database only has 25 records for now, not immediately growing)
Thank you! I appreciate the good feedback. So for your questions: _- how to ask for a confirmation before updating or deleting a record?_ I use Bootstrap modals and extra booleans for this. An example name would be "modalConfirmed". See getbootstrap.com/docs/5.0/components/modal/ _- can I migrate SQL Server DB to SQLite (my database only has 25 records for now, not immediately growing)?_ I don't know how big your records are but I'd do only 25 records manually. Also found this SO question on how to do it with code: stackoverflow.com/questions/10960433/fastest-way-to-migrate-from-sql-server-to-sqlite-for-large-datasets Hope this helps!
I make a simple TODO Task telegram bot and decide where to store the data. I'm currently using free Azure SQL, but I don't like that it pauses after a period of inactivity. So I'm thinking of either changing my plan from the current free plan to 5 DTUs for $5/month or using the SQLite method. So I have a few questions. What will happen to the database when I publish a new version of the application (given that Copy to Output directory is set to Do not copy)? Will the data remain? Or is it possible that the database will be deleted when the Web App is restarted? Also, will this work if I use the F1 Web App plan?
Hi Ruben, Thank you for terrific turorial. I just downloaded your source code and had app running successfully on my development machine. I then tried publishing to my Azure account. Tried to run there and got a SQLite type error (see below). Any ideas ? Thanks again Ruben. An unhandled exception occurred while processing the request. SqliteException: SQLite Error 14: 'unable to open database file'. Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(int rc, sqlite3 db) Microsoft.Data.Sqlite.SqliteConnection.Open()..etc etc.
Hello Ruben, Does this setup support concurrent writes? E.g.: two or more persons that access the website and would like to make a new entry into the DB. Thank you!
Hey Dan, Yes. SQLite supports concurrency somewhat. Concurrent writes at like the exact same millisecond aren't supported. Each write takes a few milliseconds so usually it shouldn't give problems. For reads concurrency is supported. I recommend taking a look at the SQLite FAQ and then entry (5): www.sqlite.org/faq.html Hope this helps. - Ruben
@@RubenHeerenDev Thank you! Yes, I saw the documentation, but in my use case, with a Blazor Wasm + WebAPI hosted on a mini-pc, it sometimes failed to write, because it did not had exclusive access to the db file. I built a hobby project in which a group of car enthusiasts share our car's travel, consumption, cost of ownership, issues with them, etc. and it happened several times to fail adding new records, when only 5 people were doing it (not all at the same time). Based on my research it could handle 50 sessions, but it failed for only 5. So I kinda' switched to MSSQL Express, although even that is an overkill, for the size of the app. However, when I tried to move it to the Azure cloud, because I was using the MSSQL database, costs were a bit on the higher end, and I went on keeping the app on my mini-pc.
With free tier for the app service your sqlite database will be killed every time your app is not used for some time. So it's just a temporary solution.
Yes, on the free tier you have a cold start, but changing from SQLite to another database provider might not fix that issue. With Entity Framework changing the database provider shouldn't take too long though.
Join the Discord community to chat with other devs and get help if you're stuck on something.
discord.gg/dcvmDnegsn
This was one of the most clear and working Blazor Server CRUD tutorials I"ve seen. I followed along end-to-end, while updating some terminology from Posts to my data set. And all was working as you showed (as expected :))
Some questions:
- how to ask for a confirmation before updating or deleting a record?
- can I migrate SQL Server DB to SQLite (my database only has 25 records for now, not immediately growing)
Thank you! I appreciate the good feedback.
So for your questions:
_- how to ask for a confirmation before updating or deleting a record?_
I use Bootstrap modals and extra booleans for this. An example name would be "modalConfirmed".
See getbootstrap.com/docs/5.0/components/modal/
_- can I migrate SQL Server DB to SQLite (my database only has 25 records for now, not immediately growing)?_
I don't know how big your records are but I'd do only 25 records manually.
Also found this SO question on how to do it with code: stackoverflow.com/questions/10960433/fastest-way-to-migrate-from-sql-server-to-sqlite-for-large-datasets
Hope this helps!
Thank you for fantastic tutorial! It's always greatly appreciated when EVERY step is shown from start to finish.
Great tutorial Ruben 👌
Thank you very much. Greetings from Ukraine.
Excellent tutorial. Thanks for sharing
I make a simple TODO Task telegram bot and decide where to store the data. I'm currently using free Azure SQL, but I don't like that it pauses after a period of inactivity. So I'm thinking of either changing my plan from the current free plan to 5 DTUs for $5/month or using the SQLite method.
So I have a few questions.
What will happen to the database when I publish a new version of the application (given that Copy to Output directory is set to Do not copy)? Will the data remain? Or is it possible that the database will be deleted when the Web App is restarted? Also, will this work if I use the F1 Web App plan?
Hi Ruben, Thank you for terrific turorial.
I just downloaded your source code and had app running successfully on my development machine. I then tried publishing to my Azure account. Tried to run there and got a SQLite type error (see below). Any ideas ?
Thanks again Ruben.
An unhandled exception occurred while processing the request.
SqliteException: SQLite Error 14: 'unable to open database file'. Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(int rc, sqlite3 db)
Microsoft.Data.Sqlite.SqliteConnection.Open()..etc etc.
Don't worry thanks Ruben .. I sorted it. The db wasn't been copied to Azure ('Copy to Output Directory' property wasn't set for AppDB.db).
Yep happened to me a lot too. Glad you figured it out!
Hello Ruben,
Does this setup support concurrent writes?
E.g.: two or more persons that access the website and would like to make a new entry into the DB.
Thank you!
Hey Dan,
Yes. SQLite supports concurrency somewhat.
Concurrent writes at like the exact same millisecond aren't supported. Each write takes a few milliseconds so usually it shouldn't give problems. For reads concurrency is supported.
I recommend taking a look at the SQLite FAQ and then entry (5):
www.sqlite.org/faq.html
Hope this helps.
- Ruben
@@RubenHeerenDev Thank you! Yes, I saw the documentation, but in my use case, with a Blazor Wasm + WebAPI hosted on a mini-pc, it sometimes failed to write, because it did not had exclusive access to the db file.
I built a hobby project in which a group of car enthusiasts share our car's travel, consumption, cost of ownership, issues with them, etc. and it happened several times to fail adding new records, when only 5 people were doing it (not all at the same time). Based on my research it could handle 50 sessions, but it failed for only 5. So I kinda' switched to MSSQL Express, although even that is an overkill, for the size of the app. However, when I tried to move it to the Azure cloud, because I was using the MSSQL database, costs were a bit on the higher end, and I went on keeping the app on my mini-pc.
Thank you. ^^
With free tier for the app service your sqlite database will be killed every time your app is not used for some time. So it's just a temporary solution.
Yes, on the free tier you have a cold start, but changing from SQLite to another database provider might not fix that issue. With Entity Framework changing the database provider shouldn't take too long though.
A tutorial on master detail please that use POS
Could you clarify?
@@RubenHeerenDev Master: Client Name, Total Amount, Discount, Paid(editable) === Detail: Item Name, Rate, Qty(editable), Discount(editable) . Items coming from Item List with Rate. Thank you. much appreciated.