Pages

Thursday, January 31, 2013

dynamic linq queries

http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx

- copy dynamic.cs into /App_code folder (get this file from: http://msdn.microsoft.com/en-us/vstudio//bb894665.aspx)
- insert top of code page: Using System.Linq.Dynamic;

Wednesday, January 30, 2013

sql server database backup + restore



Backup database:

USE DatabaseName
GO
BACKUP DATABASE DatabaseName
TO DISK = 'C:\dataFolder\db9-18-12.Bak'
GO

1      Copy the .bak file onto the local computer  into c:\dataFolder\
         Open SMS on the local computer
        Run this query to replace the existing database (* this is basic migration. This will drop existing database and replace. If appending data or something else, need to modify the query) – If the database doesn’t exist, remove the REPLACE clause (remove prior “,” also) and the new database will be created from the backup. 

Restore or create new DB:

USE MASTER
GO
RESTORE DATABASE JONDO
FROM DISK = 'C:\dataFolder\db9-18-12.Bak'
WITH
REPLACE
GO