Hi.
I've added a SQL database to my project. It's beside of the exe file in SQL folder.
I was using SQL to LINQ.
Now I wanna get a backup from it with C#.
I'm using following method :
PHP Code:
public static void GetBackUp()
{
if (!Directory.Exists(StaticVariables.BackUPFolder))
Directory.CreateDirectory(StaticVariables.BackUPFolder);
using (RezaRestaurant.SQL.DataClasses1DataContext dbc = new RezaRestaurant.SQL.DataClasses1DataContext())
{
dbc.ExecuteCommand(@"BACKUP DATABASE " + dbc.Mapping.DatabaseName + " TO DISK='c:\aaa.bak'");//Exception
}
}
But I've received the below Exception
Could you please guide me, how I can resolve it ?
Thanks.