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

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Restoring or attaching the *.mdf file

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :Sql Server
Hai,I am trying to attach the *.mdf file then i am getting the error 1813.The problem occurs when our development database transcation running out of memory disk, then I dettach database and at the time of dettaching database some of users are connected. I kill the session of all users. After I deleted the log file. Now when i am trying to attach the database then I am getting the error no 1813.Anybody urgent reply

View Complete Post

More Related Resource Links

SQL Server managment studio (Error occur Attaching a .mdf file )

An exception occur while executing a Transct-SQL statement or batch. (Microsoft.SQL server.express.Connection info)   Enable to open the physical file "E:\OutsourceProjects\shuja\MyProject_mdf\MyProject.mdf" (Operating System error 5: "5 (Access is denied.) " (Microsoft SQL server error E:5120)   Hello         I have an error while attaching a .mdf file to SQL server management studio,kindly solve my problem,i shall be very thankful. Thanks Regards Kh Hammad

Restoring 2008 Database with Filestream - Process cannot access file error

I'm trying to restore a copy of a database that has a filestream and am getting the error below. I've tried with move option to specify a new path and left it with default path, neither worked. Did a trace with procmon, didn't see anything. FileStream1 is a new folder that the restore process creates. I've deleted the folder, tried it with a new name, re-took the backup from the source machine, restarted SQL, rebooted the machine, drive permissions are open. I've run out of ideas on how to debug further. Looking up the error online wasn't much help either. Msg 3634, Level 16, State 1, Line 1 The operating system returned the error '32(The process cannot access the file because it is being used by another process.)' while attempting 'OpenFile' on 'X:\Data\FileStream1\4ecb2e48-0eee-4c99-a3f0-f1e6c7f00b24\f2efe374-9481-4c1b-a7f2-dcdcee350807\0000001b-0000aaa6-00f6'. Msg 3013, Level 16, State 1, Line 1 RESTORE DATABASE is terminating abnormally. ' SQL Server 2008 SP 1, MS Server 2008 R2 Server

Error in attaching database file and creating a new connection

I am having problem when i was trying to attach .mdf file while create a new connection of SQL server, create a new connection of SQL database file and open the database in Server Explorer. I am using VS 2010 Ultimate and SQL Express 2008 R2.Can anyone please tell me what is the problem I am facing?Here are the error message.1. Attach .mdf in SQL database file and open the database in Server Explorer2. Create a new SQL server and attach .mdf

Restoring a BAK file via SQL Server Express 2008

How can I restore a BAK file that I received from a vendor.  They were unable to find a database schema for us so they just sent us a BAK file.  I'm using SQL Server Express 2008

Restore database from file and reduce datafile while restoring


SQL 2005 Standard.

I want to restore a database from a .bak file. This bak file is referred to a database with fixed size datafile but they are bigger than I need for the new database.

Is there a way to reduce datafile size, during restore process ? I ask this because I will have to do this operation programmatically.


Converting an Infopath form to a doc or pdf, attaching that file to an email that is then sent to an


Hi, we are looking to have internal users submit a browser based Infopath form hosted on our internal Sharepoint 2010 portal, have that submission start a workflow that converts the form to a .doc or .pdf, attaches the converted form to an email and then sends the email to different external addresses depending on the value of 1 field in the form.  Is this possible?

We are running Sharepoint 2010 Enterprise and I have Infopath 2010 and Sharepoint Designer 2010.  Thank you in advance for any help!


attaching DB without .ldf file ???

  hi !!

I want to attach database to SQL Server, but  I'hv only .mdf file.

I lost .ldf file, how should i attach this DB to server ?





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)

File not found error after restoring through stsadm


I have restored my site to another server. I am getting the following error : "File not found".

I am able to access the site with _layouts_Settings.aspx

Let me know the missing part of it ?

Vijaykishan | http://v2attechhorizon.blogspot.com

Consistently restoring database files to default database file paths


Dear All,

I have a customer who is trying to restore their own customer's databases, and have the restored mdf and ldf files go to the respective default data and log file locations for that SQL instance; eg c:\sql. What they are finding is that this works for most database restores, and the mdf files and ldf files will be automatically created in the c:\sql directory; however certain databases will try and recreate under the SQL install default directory of eg: c:\program files\Microsoft SQL Server\MSSQL.1\MSSQL\data. This is a problem as they want the restore to be easy for their support guys to manage, and they are finding that sometimes databases are created in the wrong location

The only common themes here are that this is occurring on SQL Server 2005, and not 2008; and that it is the same databases everytime. They are also using the SQL Server Enterprise Manager GUI to do the restores, rather than command line.

Although I haven't ever studied this in great detail before, what I have always found is that a database which was maybe hosted on d:\SQLdata on one server will try and restore to d:\SQLdata on a second server even if the directory in question does not exist.

Can anybody shed any light on this? I am having trouble searching for solutions as the terms I need to search for give me instructional pages rather than problem posting

Restoring a SQL Server 2000 database having only the .mdf file


Hi all,

SQL Server 2000, I need to restore a database, I've only the .mdf file, note that the database was not gracefully detached, so the sp_attach_single_file_db fails. Is there any other way?

File Splitter in .Net

I love to do utility programs in .Net. And this is one of them. As I was playing with JSplit (a free file splitter program), I wondered if I could do it in .Net. The framework supports file operations like reading files in bytes and creating them. It is indeed easy to do file operations in .Net Basics on File operations

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

Creating Excel file from C#

I used below coding for create a excel sheet.I got from on web site.
In below coding there is no problem.Its create the excel file.If i run second time,its ask to overwrite the current excel file.If I said "Yes" then it ok ,but If I select cancel button,its generate the Error message.The exception is

Upload a File to a SharePoint Document Library - Part I

The following helper class demonstrates a few techniques that allow documents to be uploaded to a SharePoint document library programmatically without using the API or a custom web service. You don't need to specify a document library name, and it will create any folders specified in the URL as required. File meta data will be updated if any properties are passed.

SmtpClient and Locked File Attachments

Got a note a couple of days ago from a client using one of my generic routines that wraps SmtpClient. Apparently whenever a file has been attached to a message and emailed with SmtpClient the file remains locked after the message has been sent. Oddly this particular issue hasn't cropped up before for me although these routines are in use in a number of applications I've built.

How to call an .exe file in .net

Sometimes a developer has to call an EXE from another EXE. While calling EXE there can be a requirement to pass parameter.
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