none
vs2005 to vs2010

    Question

  • Hi all

    I have Visual Studio 2005 and a c# project that in one  part of that i could backup from my Database corectly. i switch to VS2010 but in VS2010 i can't backup from my DB and an error occured:

    Backup failed for Server '\\.\pipe\1DF4299B-C2F9-42\tsql\query'.


    would you please help me?

    Tnx

    Monday, September 20, 2010 1:59 PM

Answers

  • Hi,

    Thanks for your update.

    The code looks fine. The problem seems to be that the pipe name in the connection string in your program is not mapped to the one configured for SQL Server where your database exists. You can either update the pipe name in the connection string to the one specified for SQL Server or configure the pipe name of SQL Server to the one in the connections.

    To configure pipe name for SQL Server, please follow the steps:

            1.     Open SQL Server Configuration Manager (SSCM) from Start -> All Programs -> Microsoft SQL Server -> Configuration Tools;

            2.     In the SSCM, go to SQL Server Configuration Manager (Local) -> SQL Server Network Configuration -> Protocols for <SQLInstanceName>;

            3.     Double-click or right-click Named Pipes protocol to open Named Pipe Properties dialog in the right panel, change the pipe name in the Pipe Name text box.

    After you change the pipe name of SQL Server, you can update it in the connection string. If it still does not work, please post 1-connection string, 2-pipe name of the SQL Server where your database exists.

    Hope this helps.

    Thanks,
    Chunsong


    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Monday, September 27, 2010 2:07 AM
    Moderator

All replies

  • Hi,

    Could you please elaborate on how you switch from VS2005 to VS2010 and How you backup from your database?

    From the error message, the server could not be found according to this pipe name. Please check whether Named Pipes protocol is enabled as weell as pipe name in the SQL Server Configuration Manager.

    Thanks,
    Chunsong


    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Wednesday, September 22, 2010 8:22 AM
    Moderator
  • Thank you for your answer.Here is my code for backup:

    string sconnect = Properties.Settings.Default.vertragConnectionString;
          string dbname;
          using (SqlConnection cnn = new SqlConnection(sconnect))
          {
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
              cnn.Open();
              dbname = cnn.Database.ToString();
              
              ServerConnection sc = new ServerConnection(cnn);
              Server sv = new Server(sc);
              BackupDeviceItem bdi = new BackupDeviceItem(saveFileDialog1.FileName, DeviceType.File);
              Backup bk = new Backup();
              bk.Devices.Add(bdi);
              bk.Action = BackupActionType.Database;
              bk.BackupSetDescription = "babak";
              bk.BackupSetName = "bastan";
              bk.Database = dbname;
              bk.SqlBackup(sv);
            }
    
          }
    

    When i only have SQL server 2005 it works corectly but when i installed VS2010 it doesn't work. for both of them(SQL 2005 & SQL 2008) Named Pipes 

    Enabled is true .

    i changed the enabled of each other to false but doesn't work

    Friday, September 24, 2010 12:40 PM
  • Hi,

    Thanks for your update.

    The code looks fine. The problem seems to be that the pipe name in the connection string in your program is not mapped to the one configured for SQL Server where your database exists. You can either update the pipe name in the connection string to the one specified for SQL Server or configure the pipe name of SQL Server to the one in the connections.

    To configure pipe name for SQL Server, please follow the steps:

            1.     Open SQL Server Configuration Manager (SSCM) from Start -> All Programs -> Microsoft SQL Server -> Configuration Tools;

            2.     In the SSCM, go to SQL Server Configuration Manager (Local) -> SQL Server Network Configuration -> Protocols for <SQLInstanceName>;

            3.     Double-click or right-click Named Pipes protocol to open Named Pipe Properties dialog in the right panel, change the pipe name in the Pipe Name text box.

    After you change the pipe name of SQL Server, you can update it in the connection string. If it still does not work, please post 1-connection string, 2-pipe name of the SQL Server where your database exists.

    Hope this helps.

    Thanks,
    Chunsong


    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Monday, September 27, 2010 2:07 AM
    Moderator