Hello,
Reg sql compact… is it ok to download the live database, replace it in the "app data" folder in webmatrix, make changes to the database like add tables etc and then again replace it in the live site?
Yes, it is OK to do so! SQL Server CE is a file based database, so it will be ok to perform this function in your application for updating the database objects.
Yes.
Use Remote Download then select the db.
Then Use Publish and select the db.
If you have active users on your site they may get a file in use error.
wavemaster
Yes.
Use Remote Download then select the db.
Then Use Publish and select the db.
Not only from WebMatrix, but from other tools too. WebMatrix supports SQL Server CE schema and editing, so WebMatrix is the only tool free, there might be other third-parties working with it.
Instead of error, you should show a custom message saying Under construction.
Which reminds me, create a single page called app_offline.html and put your out of service message there.
Then you do the db work
Then you rename the file to something else.
You could add an extra page to your site that has a form with a textarea in it. Then you can submit SQL that makes the changes to your database live. Obviously, the page needs to be protected against unauthorised access. At least that way, your visitors
won’t be inconvenienced.
Do u mean I make changes to sql(like alter table, create table etc) through a form?
Is that you suggest is better or redirect users to a maintenance page, downoad the database file, make changes and then replace it in th live app_code folder?
Gautam Sharma
Do u mean I make changes to sql(like alter table, create table etc) through a form?
Yes.
Gautam Sharma
Is that you suggest is better
It depends. If you can let your users wait for you to download the db, make changes and then upload it again, do so. If you make changes via a form, they will be available instantly and users will not be troubled at all.
@Mike,
Sounds good to me. Lets say the changes are too many and changes take approx. 30min to 1hour just to make sure everything works fine.
what is the ideal way for redirection to maintenance page…
1) replace login page with maintenance page
2) authenticate the user and then redirect the user to login page( have to place a redirect in the _pagestart of protected folder too)..
Use an App_Offline.htm file like wavemaster said: http://weblogs.asp.net/scottgu/426755
Can your users handle such a long down time? Are their activities time sensitive? They are working and they need your site to function to do their work?
You could do your changes after hours, late at night or early in the day.
I have always used the app_offline file, but now that my site gets more traffic I am more and more trying to do db maintenance with code. I have a identical site as the live site where I develop and test the code for the db maintenance. When it is all functioning
as desired I copy the code to the live site, take it off line for a few minutes and execute the code.
That code requires the admin user role to run.
i love this file "app_offline"
made life easy