Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
K

kutbinayi

@kutbinayi
About
Posts
9
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SQL SERVER 2008 Express Backup and Restore using SMO does not effect database
    K kutbinayi

    Ok, thank you for all of your replies. As a result using SqlBackup method instead of SqlBackupAsync is better solution for me. And if i solve the file path problem in my code, then everything seems to work great, right.

    C# database sql-server sysadmin security

  • SQL SERVER 2008 Express Backup and Restore using SMO does not effect database
    K kutbinayi

    Ok, but why this does not occur when I use SqlBackupAsync method ?

    C# database sql-server sysadmin security

  • SQL SERVER 2008 Express Backup and Restore using SMO does not effect database
    K kutbinayi

    what could be the reason of not accepting this file path ? Because there is no restriction to save file to my Desktop folder.

    C# database sql-server sysadmin security

  • SQL SERVER 2008 Express Backup and Restore using SMO does not effect database
    K kutbinayi

    The whole exception is this :

    Microsoft.SqlServer.Management.Smo.FailedOperationException: Backup failed for Server 'EMRE-PC\SQLEXPRESS'. ---> Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. ---> System.Data.SqlClient.SqlException: Cannot open backup device 'C:\Users\EMRE\Desktop\YEDEK.bak'. Operating system error 5(failed to retrieve text for this error. Reason: 15105).
    BACKUP DATABASE is terminating abnormally.
    konum: Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
    konum: Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
    --- İç özel durum yığını izlemesinin sonu ---
    konum: Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
    konum: Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType)
    konum: Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQuery(StringCollection queries)
    konum: Microsoft.SqlServer.Management.Smo.BackupRestoreBase.ExecuteSql(Server server, StringCollection queries)
    konum: Microsoft.SqlServer.Management.Smo.Backup.SqlBackup(Server srv)
    --- İç özel durum yığını izlemesinin sonu ---
    konum: Microsoft.SqlServer.Management.Smo.Backup.SqlBackup(Server srv)
    konum: _15_49KADINIZLEM.DbConnection.BackUpDB(String DBpath) C:\Users\EMRE\documents\visual studio 2010\Projects\15-49KADINIZLEM\15-49KADINIZLEM\DbConnection.cs içinde: satır 107

    Backup failed for Server 'EMRE-PC\SQLEXPRESS'.

    C# database sql-server sysadmin security

  • SQL SERVER 2008 Express Backup and Restore using SMO does not effect database
    K kutbinayi

    Yes but when I use SqlBackup method then it nevers succeed backup operation. and catches an exception on data object System.Collections.ListDictionaryInternals. I think this object is used by SqlBackup method. If I use SqlBackupAsync then no exception is thrown. I catched all exceptions but it is not seen in the above code. I just use it while I was trying. Is it normal that SqlBackupAsync succeeds the backup operation but restoring the database does not affect the database ? What could be other reasons ?

    C# database sql-server sysadmin security

  • SQL SERVER 2008 Express Backup and Restore using SMO does not effect database
    K kutbinayi

    Hi, in my project I tried to backup my database and then restore using SMO. While backing up and restoring it gives no errors and catches no exception. All of them seem to work great. However, after I perform backup to a file, I deleted the data and/or a table from my database to see whether restoring operation will perform correctly or not. However, when I deleted a table or just data in the table, if I perform restore operation, neither the table nor the data in the table comes back. As a result either backup or restore operation does not work correctly. My backup and restore methods are as in the following :

    public bool BackUpDB(string DBpath)
    {
    try
    {
    // Create a new connection to the selected server name
    ServerConnection srvConn = new ServerConnection(Program.serverName);
    // Log in using SQL authentication instead of Windows authentication
    srvConn.LoginSecure = true;
    // Create a new SQL Server object using the connection we created
    srvr = new Server(srvConn);
    // If the user has chosen a path where to save the backup file
    // Create a new backup operation
    Backup bkpDatabase = new Backup();
    // Set the backup type to a database backup
    bkpDatabase.Action = BackupActionType.Database;
    // Set the database that we want to perform a backup on
    bkpDatabase.Database = Program.databaseName;
    //set incremental to false because this is full backup
    bkpDatabase.Incremental = false;
    bkpDatabase.Initialize = true;
    //Specify that the log must be truncated after the backup is complete.
    bkpDatabase.LogTruncation = BackupTruncateLogType.Truncate;
    // Set the backup device to a file
    BackupDeviceItem bkpDevice = new BackupDeviceItem(DBpath , DeviceType.File);
    // Add the backup device to the backup
    bkpDatabase.Devices.Add(bkpDevice);
    // Perform the backup
    bkpDatabase.SqlBackupAsync(srvr);
    return true;
    }
    catch (Exception)
    {
    return false;
    }
    }

    The following is my restore method :

    public bool RestoreDB(string DBpath)
    {
    try
    {
    // Create a ne

    Database database sql-server sysadmin security

  • SQL SERVER 2008 Express Backup and Restore using SMO does not effect database
    K kutbinayi

    Hi, in my project I tried to backup my database and then restore using SMO. While backing up and restoring it gives no errors and catches no exception. All of them seem to work great. However, after I perform backup to a file, I deleted the data and/or a table from my database to see whether restoring operation will perform correctly or not. However, when I deleted a table or just data in the table, if I perform restore operation, neither the table nor the data in the table comes back. As a result either backup or restore operation does not work correctly. My backup and restore methods are as in the following :

    public bool BackUpDB(string DBpath)
    {
    try
    {
    // Create a new connection to the selected server name
    ServerConnection srvConn = new ServerConnection(Program.serverName);
    // Log in using SQL authentication instead of Windows authentication
    srvConn.LoginSecure = true;
    // Create a new SQL Server object using the connection we created
    srvr = new Server(srvConn);
    // If the user has chosen a path where to save the backup file
    // Create a new backup operation
    Backup bkpDatabase = new Backup();
    // Set the backup type to a database backup
    bkpDatabase.Action = BackupActionType.Database;
    // Set the database that we want to perform a backup on
    bkpDatabase.Database = Program.databaseName;
    //set incremental to false because this is full backup
    bkpDatabase.Incremental = false;
    bkpDatabase.Initialize = true;
    //Specify that the log must be truncated after the backup is complete.
    bkpDatabase.LogTruncation = BackupTruncateLogType.Truncate;
    // Set the backup device to a file
    BackupDeviceItem bkpDevice = new BackupDeviceItem(DBpath , DeviceType.File);
    // Add the backup device to the backup
    bkpDatabase.Devices.Add(bkpDevice);
    // Perform the backup
    bkpDatabase.SqlBackupAsync(srvr);
    return true;
    }
    catch (Exception)
    {
    return false;
    }
    }

    The following is my restore method :

    public bool RestoreDB(string DBpath)
    {
    try
    {
    // Create a

    C# database sql-server sysadmin security

  • Error 1001 : Unable to get installer types in my InstallHelper.dll assembly
    K kutbinayi

    Actually I have solved it but in a different way. The problem was a class library project. The output of it is a *.dll file and installer could not find that file. In that installer class I called a windows form to enable to add user while setup. However, when dll file could not find, then instead of it I tried to add an *.exe output as my Installer class. So, instead of class library project I have added a windows form project to my setup project. Since its output is .exe file, then it works great. Now my setup works correctly. If anyone encountered this problem may try to replace class library project with windows form project. It is a lazy solution for my situation. But, still I am wondering what the actual reason to this problem is.

    C# help csharp database visual-studio tutorial

  • Error 1001 : Unable to get installer types in my InstallHelper.dll assembly
    K kutbinayi

    Hi, I am working on a C# project in visual studio 2010. I have finished the project and now working on its setup project. I created a setup project and another Installer class project. In custom actions of my setup project I use my Installer class to add a login user to the database. However after coppied the project files to the target machine, when my installer class needs to work en error occurs. It says unable to get installer types in InstallHelper.dll assembly which is created by me. I could not understand why it is happening. One important thing is that, It does not occur on my machine maybe it is because i devolopped the project in my machine and it is windows 7 professional. However in other machines always this error occurs. For example, I tried it in Windows Vista, Windows 7 Professional (32-bit) and also (64-bit) always this error occurs. Can anyone help me in this issue ? What should I do ? Please it is a bit urgent.

    C# help csharp database visual-studio tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups