.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

returning backup file

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :Sql Server
 
Hi all. I want send backup statement from my c# code to sql server then sql server return same back up file to my application in varbinary(max). what code is necessary for that? I use windows application by c#.


View Complete Post


More Related Resource Links

returning backup file to application

  

Hi all. I want send backup statement from my c# code to sql server then sql server return same back up file to my application in varbinary(max). what code is necessary for that?


Returning datas from two excel file

  

Hi,

I used the below code to return the datas from one excel file. My question is if i suppose need to get the records from morethan one excel file using joins, how it is possible.

   string connString = ConfigurationManager.ConnectionStrings["xls"].ConnectionString;
        // Create the connection object 
        OleDbConnection oledbConn = new OleDbConnection(connString);
         // Open connection
            oledbConn.Open();
 
            // Create OleDbCommand object and select data from worksheet Sheet1
            OleDbCommand cmd = new OleDbCommand("SELECT * FROM [Sheet1$]", oledbConn);
 
            // Create new OleDbDataAdapter 
            OleDbDataAdapter oleda = new OleDbDataAdapter();
 
            oleda.SelectCommand = cmd;
 
            // Create a DataSet which will hold the data extracted from the worksheet.
            DataSet ds = new DataSet();
 
            // Fill the DataSet from the data extracted from the worksheet.
            oleda.Fill(ds, "Employees");


 

 

-ThHanks


Toolbox: Easy File Backup, Exploring Files And Folders Inside Visual Studio, Multiple Monitor Softwa

  

If the responsibility for creating, managing, and executing routine backups is yours, these tools will make it easier. Also see how you can browse folders and files from inside Visual Studio.

Scott Mitchell

MSDN Magazine May 2009


SQL Server backup failing on one file

  
Hi I have a server which is not backing up a db each day. When I look at the event log it displays the following...   SQL Server has encountered 1 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [D:\########\########_File_CS_DefaultData.ndf] in database [########] (5). The OS file handle is 0x000006A0. The offset of the latest long I/O is: 0x00000008e00000 2010-08-16 16:07:38.19 Backup Error: 3203, Severity: 16, State: 1. 2010-08-16 16:07:38.19 Backup Read on "D:\########\########_File_CS_DefaultData.ndf" failed: 1117(failed to retrieve text for this error. Reason: 15100) 2010-08-16 16:07:38.20 Backup Error: 3041, Severity: 16, State: 1. 2010-08-16 16:07:38.20 Backup BACKUP failed to complete the command BACKUP DATABASE ########. Check the backup application log for detailed messages. 2010-08-16 16:12:14.32 spid5s SQL Server has encountered 2 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [D:\########\########_File_CS_DefaultData.ndf] in database [########] (5). The OS file handle is 0x000006A0. The offset of the latest long I/O is: 0x00000009900000 2010-08-16 16:13:07.02 Backup Error: 3203, Severity: 16, State: 1. 2010-08-16 16:13:07.02 Backup Read on "D:\########\########_File_CS_DefaultData.ndf" failed: 1117(failed to retrieve text for this error. Reason: 15105) 2010-

Can't restore database backup file in my database ? using sql server 2005. please help

  
VERY IMPORTANT i am trying to restore database.bak in sql server 2005 (i know the database.bak was also generated in sql 2005 server) i am trying to restore back up database .bak into the new database i just created in sql server 2005 i have saved my database .bak into c drive and when i select database .bak "From Device", it doesn't get populated in the list below and i see nothing and it keeps on prompting a message "You must select a restore source" Here's the screen shot:   PLEASE HELP..it's really important (i tried restoring database in sql server 2008 and it was sucessful but i am facing this problem in sql server 2005 only)  

Why doesn't SQL Server 2005 Enterprise always shrink a log file after a backup?

  
I have several databases that, despite being backed up regularly, do not release space to the operating system.  In one extreme case, I have a log file that is less than 1% utilized (and has been for months.) I know how to manually force a shrink, but I should not need to do that on any sort of regular basis.  In fact, it is against best practices to manually shrink a log file (or any database file for that matter) because of the very high risk of an unrecoverable error. It is my understanding that SQL Server will eventually handle these things on its own.  However, it does not appear to be doing so.  Any thoughts as to why? Thanks, Dave

TDE disabled and service restarted but still can't restore a new backup file

  
Hello, I disabled TDE on my dev database because we determined no personally identifiable info will be stored.  Disabling was done like so:Then I created a backup of MyDB database and tried to restore on a different server instance on my same machine (using SSMS) and I get  the following error: ALTER DATABASE MyDB SET ENCRYPTION OFF GO use MyDB go drop database encryption key go use master go DROP certificate DevCert GO DROP MASTER KEY GO Afterwards, I ran the following query to ensure there are no encrypted databases, and it returns zero rows: SELECT DB_NAME(database_id) AS dbname, encryption_state, case encryption_state   WHEN 0 THEN 'Unencrypted (no database encryption key present)'   WHEN 1 THEN 'Unencrypted'   WHEN 2 THEN 'Encryption in Progress'   WHEN 3 THEN 'Encrypted'   WHEN 4 THEN 'Key Change in Progress'   WHEN 5 THEN 'Decryption in Progress'   ELSE CAST(encryption_state AS varchar(20)) END AS encryption_state, key_algorithm, key_length FROM sys.dm_database_encryption_keys Then I created a backup of MyDB database and tried to restore on a different server instance on my same machine (using the SSMS) and I get the following fatal error: The media family on device 'c:\Program Files\...\Backup\TDE_removed_from_db.bak' is incorrectly formed.  SQL Server cannot process this media family. 

Multiple databases backup/restore in a transaction, if possible, into only one file

  

Hi dear,

I have three databases named XDW, XOLTP, XOLTPSchema. All of these are for only one application. In the application, user should do backup/restore using GUI.

So...

1. How I should do backup/restore in one transaction? i.e. all of three actions should be success elsewhere all of them should fail.

2. Is it possible to backup them into only one file e.g. X.bak?

3. Or, What is the standard solution in this condition?

Thanks in advance.


LEARN "LINQ TO DATASET" DURING A QUICK SIMPLE HOW TO:
How To: Joining multiple DataTable using “LINQ to DataSet”

How can I shrink the size of LDF file after BACKUP LOG?

  

Ive just done BACKUP LOG against particular database and found no changes in size for the appropriate LDF file. It is shrunk only after I issue:

ALTER

 

DATABASE dssip

SET

 

RECOVERY SIMPLE

But this approach breaks all logs chain. Is there any way to shrink the LDF file for FULL backup model without destroying the whole sequece of log backups?


How to retrieve the mysql backup file (backup.sql) into sql

  
--SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `ebhcemr`
--
CREATE DATABASE ebhcemr DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE ebhcemr;
go
-- --------------------------------------------------------

--
-- Table structure for table `addresses`
--

CREATE TABLE  addresses (
  id int(11) NOT NULL default '0',
  line1 varchar(255) default NULL,
  line2 varchar(255) default NULL,
  city varchar(255) default NULL,
  [state] varchar(35) default NULL,
  zip varchar(10) default NULL,
  plus_four varchar(4) default NULL,
  country varchar(255) default NULL,
  foreign_id int(11) default NULL,
  PRIMARY KEY  (id),
  KEY foreign_id (foreign_id)
)ENGINE=MyISAM DEFAULT CHARSET=latin1;


How to make a backup file (.bak) from a database (.mdf)

  

I need to make a backup file(.bak) of a database(.mdf)

I learned I need to use MS SQL Server management studio Express to do so, but I can't figure it out how.

I don't know how to connect to the database using this program. In the "Connect to Server" dialogue window, I am supposed to choose a server name from the dropdown list, but nothing comes up. What am i doing wrong? Pls see the screet shot. Please help!



In Log-shipping what is load delay period on secondary server - Skipping log backup file since load

  

During logshipping, job on secondary server is ran successfully BUT give this information

"Skipping log backup file since load delay period has not expired ...."

What is this "Load delay period" ? Can we configure this somehow, somewhere ?


NOTE : The value on "Restore Transasction Log tab", Delay Restoring backups at least = Default (zero minutes)

Thanks


Think BIG but Positive, may be GLOBAL better UNIVERSAL.

Problem in restoring backup file

  


at System.DBNull.System.IConvertible.ToBoolean(IFormatProvider provider)
   at System.Convert.ToBoolean(Object value, IFormatProvider provider)
   at Microsoft.SqlServer.Management.SqlManagerUI.BakDevMediaContents.InitBackupSets(Restore sqlRestore)
   at Microsoft.SqlServer.Management.SqlManagerUI.BakDevMediaContents.InitProp()
   at Microsoft.SqlServer.Management.SqlManagerUI.BakDevMediaContents.InitializeOffline(CDataContainer dataContainer)
   at Microsoft.SqlServer.Management.SqlManagerUI.BackupDeviceContents..ctor(CDataContainer dataContainer, IServiceProvider sp)
   at Microsoft.SqlServer.Management.SqlManagerUI.SqlRestoreSelectBackupSource.buttonContents_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)

CHeck to see if file exists on Server before backup

  

Hello,

  I want to check first to see ifthe xyz.bak file exsits before I perform a backup.

 

Thanks


File system permission error during BACKUP service master key

  

Hi,

I'm having a strange issue with file system permissions.

A backup database to file location e:\sqlbackup works fine.
A BACKUP SERVICE MASTER KEY or BACKUP MASTER KEY fails with the error ´MSG 15240, Level 16, State 1 Cannot Write into file ´e:\sqlbackup\file.bak' Verify that you have write permissions, etc...'

What am I missing?

Thanks!


The backup file should be restored to a server with version '763911617.771019783.639568184.35790308

  

On trying to restore a site backup from one moss server to another using STSADM i encountered this error.

Your backup is from a different version of Windows SharePoint Services and cannot be restored to a server running the current version. The backup file should be restored to a server with version '763911617.771019783.639568184.357903087' or later.

The versions of MOSS at both server is 12.0.0.6524.  What is the version numbers indicated in the error message. Is it the Servers Operating System updates version. Where can i find the relevance of the numbers

 

 

 

 


pv
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend