I have a table in sql server which contains the info of the files that are uploaded.
it has the id, name, size, content, created dt and the modified dt of all the files.
now my task is that i wanna copy the files from the db to my local drive.
is it possible thru C# console application..
please help..
thanks in advance,
Abinaya
Mukesh Kumar TiwariPosted Nov 8, 2013, 6:49 AM
{
SqlConnection con = new SqlConnection(Connection.GetConnection());
SqlCommand command = new SqlCommand();
command.CommandText = "backup database [Pharmacy Database]to disk ="+"'"+path +"'"; command.CommandType = CommandType.Text;
command.Connection = con;
con.Open();
command.ExecuteNonQuery();
con.Close();
}
Note: At the place of the path u have to pass the folder or drive name where u wnat to take the back up.....its working for me........