I'm running an ASP.NET MVC app, in shared hosting. My data is in a SQL Server Compact database "sdf" file.
I have a limited amount of diskspace. I'm worried that I'll go over that limit and my site will break. I can FTP into my account, and check the sdf file's size, but that is a slow manual annoying process.
So, during runtime, given nothing but the connection string, can I determine the database's size on disk?
yes you can.
btw, you can in your connection string restrict max size of your sdf file
this will restrict grows over 256MB - default if I remember correctly 128MB
and path to your database should be like this: