how to copy database files from the network access server to Client PC in c#.net?

Posted by zoya on Stack Overflow See other posts from Stack Overflow or by zoya
Published on 2010-03-19T06:11:11Z Indexed on 2010/03/19 6:21 UTC
Read the original article Hit count: 205

Filed under:
|
|
|
|

im using a code to copy the files from the database of server PC. so im accessing that server PC through IP address but it is giving me error and not copying the files in the folder of my PC (client PC) this is my code that im using...can u tell me where im wrong??

the file path is given on my listview in winform..

public string RecordingFileCopy(string recordpath,string ipadd)
    {
        string strFinalPath;
        strFinalPath = String.Format("\\{0}'{1}'",ipadd,recordpath);
        return strFinalPath;
    }

on button click event.... {

try
            {

                foreach (ListViewItem item in listView1.Items)
                {
                    string sourceFile = item.SubItems[5].Text;
                    RecordingFileCopy(sourceFile,"10.0.4.123");  
                    File.Copy(sourceFile, Path.Combine(@"E:\name\MyDir", Path.GetFileName(sourceFile)));
                }

            }
            catch
            {
                MessageBox.Show("Files are not copied to folder", _strMsg, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

}

© Stack Overflow or respective owner

Related posts about database

Related posts about network