I want to backup database in SQL Server 2012 using this code:
BACKUP DATABASE aveed_co
TO DISK = 'C:\bakup.bak'
WITH FORMAT,
MEDIANAME = 'aveed_co',
NAME = 'aveed_co'
After execution this code in SQL Server Management Studio, I get this error:
Msg 233, Level 20, State 0, Line 0
A transport-level error has occurred when sending the request to the server.
(provider: Shared Memory Provider,error: 0- No process is on the other end of the pipe.)
To solve this problem I must change log on type (in SQL Server configuration) as below:

In other hand I must change "log on as" from "Built-in account" (1) to "This account" (2).
When I change "log on as" to "This account" and enter username and password the SQL Server code execute correctly.
Note that I have permission to write on c: or any driver
Please help me to do this using C# or SQL Server code.