Thursday 30 April 2015

cannot open backup device operating system error 5(access is denied.)

possible reason for this errors are,

1. there is no directory with the name
ex, if u r mention path as 'D:\test\abc.bak' may be this directory wont be there or not access for your credentials.
2.second possible is, u wont be having enough space in the disk to save the data.
3.you may not having enough permission/rights in logs drive
ex, if your mention a folder name, for that folder u might not having write permission, something like that.

how to take database backup using sql query

in query window use this syntex:

backup datsbase databasename to disk='location to store'


Example:

backup database sureshdatabase in disk = 'D:\sureshDBBackup\sureshdatabase.bak'

after forming this query execute.




Friday 17 April 2015

assign null value to enum in c#

You can use the "?" operator for a enum nullable type.

Ex:
public enumname? objenum = null;

or else u can create one more enum as none then use it.