All of the backups made using SQL Server backup command can be taken online (when the database is in use). To understand the concepts, go through:
-
http://msdn.microsoft.com/en-us/library/ms189275.aspx[
^]
-
http://msdn.microsoft.com/en-us/library/ms187048.aspx[
^]
The actual backup can be taken with:
http://msdn.microsoft.com/en-us/library/ms186865.aspx[
^]. However, I don't suggest that you put this in your application. The backups should run independently from other applications. If you're using Standard or Enterprise edition of Sql Server, use the maintenance plan wizard to create a backup plan.
Also i have an problem with connection string ; as when we start the project then it asks for Accounting year then when you select the the year then the database folder which related to this year must be selected for operation...
This doesn't make sense. If you're using SQL2005 (as your tag says) application does not need to know where the database files are. It's strictly controlled by the Sql Server service.