Thursday, February 16, 2012

<<< I couldnt backup my SQL Databases >>> !!!

here is Codes
////////////////// textBox1.Text = ADEMTEKEREK (server
computer's name)
FileInfo SourceFile1=new FileInfo("\\\\" + textBox1.Text +
"\\c\\Program Files\\Microsoft SQL
Server\\MSSQL\\Data\\MYDATABASE_Data.Mdf");
FileInfo SourceFile2=new FileInfo("\\\\" + textBox1.Text +
"\\c\\Program Files\\Microsoft SQL
Server\\MSSQL\\Data\\MYDATABASE_Log.Ldf");
SourceFile1.CopyTo("D:\\",true);
SourceFile2.CopyTo("D:\\",true);
...and when i start my form, there is this Error Message
Could not find file"\\ADEMTEKEREK\c\Program Files\Microsoft SQL
Server\MSSQL\Data\MYDATABASE_Data.Mdf"
WHAT CAN I DO...'?
thnks for now....< wrote on 6 Apr 2006 02:02:09 -0700:

> here is Codes
> ////////////////// textBox1.Text = ADEMTEKEREK (server
> computer's name)
> FileInfo SourceFile1=new FileInfo("\\\\" + textBox1.Text +
> "\\c\\Program Files\\Microsoft SQL
> Server\\MSSQL\\Data\\MYDATABASE_Data.Mdf");
> FileInfo SourceFile2=new FileInfo("\\\\" + textBox1.Text +
> "\\c\\Program Files\\Microsoft SQL
> Server\\MSSQL\\Data\\MYDATABASE_Log.Ldf");
> SourceFile1.CopyTo("D:\\",true);
> SourceFile2.CopyTo("D:\\",true);
> ...and when i start my form, there is this Error Message
> Could not find file"\\ADEMTEKEREK\c\Program Files\Microsoft SQL
> Server\MSSQL\Data\MYDATABASE_Data.Mdf"
> WHAT CAN I DO...'?
> thnks for now....
Do you have a share named "c" on the machine ADEMTEKEREK that is mapped to
the root of drive c? Does the account this code runs under have access to
network shares?
I'd also recommend that you don't just copy the MDF and LDF files as a
backup - if these are in use by SQL Server you will likely end up with
unusable files. Have SQL Server do a BACKUP and then copy those files.
Dan

No comments:

Post a Comment