When the connection string is like
Data Source=IMMENSE-01\\SQLEXPRESS;Initial Catalog=dipar;Integrated Security=True
I can use this query to backup database
backup database dipar to disk ='F:\DBBackup\dipar.bak' with init,stats=10
But when I keep the database along with the program to make a executable file, the connection string is like
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\dipar.mdf;Integrated Security=True;User Instance=True
and the query to take backup backup database dipar to disk ='F:\DBBackup\dipar.bak' with init,stats=10 Says database not found.
Please help