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

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

Attach .mdf file in sqlserver 2005 ( why Read-Only mode)

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :ASP.Net


i am new to Sqlserver2005, when i attach .mdf file it takes Read-only mode, how to change it into writeable?

pls help me any one... and advance thanks

View Complete Post

More Related Resource Links

Moved from WinXP to Win7 - don't see choice to open file in read only or edit mode


I just recently moved from Win XP Pro SP3 to Win 7 32-bit Pro. I am logging into domain X normally. Our Sharepoint 2007 server authenticates only on domain Y. So I start Internet Explorer with "run as different user" and provide my domain Y credentials. All fine. 

In win XP, after I did this, when I click on an Excel file on Sharepoint, I would get a dialog asking if I wanted to check out and edit or open as read only. 

In win7, I don't get that choice. The file simply opens, and I get a bar at the top which allows me to check out the file if I wanted to. 

How can I restore the functionality I used to have, with the dialog for checking out the file before opening it?

Read Binary Data which is nothing but a Zip file and unzip through SSIS 2005 SP2

Hi ALL, I need some help in developing a task. I have a source database which is Oracle and it has a ZIP file stored inside the database in Binary format. When I move this data into the sql server 2005 database I get the data as binary data. Now the task begins with SSIS, I need to read the binary data which gives us a zip file and then unzip this zip file and read the XML data which is present inside the Zip file. I beleive some one might have already developed this task can you share the solution with us. Note: As this has to be moved into production I dont have permission to use third party tools like Cozy roc or install winrar.exe and simpy calling this exe from the execute process task in SSIS.  Raju

How to Encrypt and Decrypt a Password using SQLSERVER 2005?(Video)

Encypt and Decrypt a Password using SQLSERVER 2005(Video)

I am not able to read xml file with XDocument if its Descendants has Attribute xmlns="http://abc.co


I am not able to read xml file with XDocument if its Descendants has  Attribute like:-

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
  <row ID="1" xmlns="http://www.opentravela.org/OTA/2003/05">
    <var country_name="Caribbean and Rest of the world" city_name="Kingston" flight_category="Economy Class" via="Atlanta" flight_departure="London Heathrow" airline_logo="Delta" adult_fare="Delta" child_fare="660" infant_fare="561" date1="132" date2="2010-08-15" />


I don't know what to do ?

Looking for some help..

Read Excel file from Web Application (C#)



I have a web app where user uploads a file.

File is saved in server locally and I want to read some data from it.

Currently my development  server has office 2003.

So do I need office 2007 in order to be able to  read an excel from office 2007 ?

What are other requirements  ?

I tried a test, using

Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook wrkBook; // = new Microsoft.Office.Interop.Excel.Workbook();

wrkBook = excelApp.Workbooks.Open(@"C:\www\excel_files\b.xls", ....);

But When trying to open the file I get the error:

Exception from HRESULT: 0x800A03EC

So I'm wondering what I'm missing.


SSRS 2005 "Mixed" Authentication Mode


I have a web application where users can authenticate using either SiteMinder or Windows domain accounts.  This is actually configured as two separate virtual directories within IIS 6.  Both applications need to use the same instance of SSRS.  Is it possible to configure the SSRS web application so that if a user is authenticated by SiteMinder it impersonates a Windows account, but if they are already Windows-authenticated that account is used instead?

Upgrading VS 2003 Project File to VB Express Edition 2005



I downloaded some project from some site which is made in VS 2003. When I open its project file in Notepad I get following at first line Microsoft Visual Studio Solution File, Format Version 8.00. I don't have VS 2003 in my PC but I have VB 2005 and 2008 Express Edition. Now I wanted to upgrade that file but it is not doing. Can somebody help to upgrade it.

Create excel file from Binary data on SqlServer



My requirement is that i upload an excel file then i need to validate that data.


1. Uploading file using using upload control saving binary in SqlServer

2. Then i am creating file from binary data  on Sql Server using below command and then using OPENROWSET to dump data to Sql table

3. Then reading Sql Table row wise and validating data.


Alter Procedure spUploadExcelFile
  @PKID int,
  @BatchID int


	Declare @VarBin varbinary(max)
	Declare @FileName varchar(100)
	DECLARE @sql nvarchar(MAX)
                DECLARE @errMsg nvarchar(MAX)
	DECLARE @ObjectReturn INT
	DECLARE @ErrorSource VARCHAR(255)
	DECLARE @ErrorDesc VARCHAR(255)
	DECLARE @ObjectToken INT

	Select @VarBin  = Content , @FileName = [FileName] from MultilangBinaryData Where PKID = @PKID
	SET @FileName = 'C:\'  + @FileName
	EXEC sp_OACreate 'ADODB.Stream' @ObjectToken OUTPUT
	EXEC sp_OASetProperty @ObjectToken, 'Type', 1
	EXEC sp_OAMethod @ObjectToken, 'Open'
	EXEC sp_OAMethod @ObjectToken, 'Write', NULL, @VarBin
	EXEC sp_OAMethod @ObjectToken, 'SaveToFile', NULL, @FileName, 2
	EXEC sp_OAMethod @ObjectToken, 'Close'
	EXEC sp_OADestroy @ObjectToken  
	SET @sql = 'INSERT INTO dbo.UserBulkData SELECT 0,NULL,'+ @BatchI

Can Not load WPF project in Visual Studio 2005 on Win7 64 system, says "Project file not supported b

Dear all I am facing an issue in creating new wpf project or loading a WPF project in Visual studio 2005. I have installed Visual Studio 2005 Service pack - 1 (http://www.microsoft.com/downloads/details.aspx?familyid=bb4a75ab-e2d4-4c96-b39d-37baf6b5b1dc&displaylang=en) but still I can not see the option for wpf project  while creating a new project. Generally we can see WPF listing under item File -->New-->Project--> ".Net Framework 3.0" in VS 2005. I have few WPF project and when i try to load them it says "Project file not supported by this Installation". My System Config is given below: OS: Windows 7 (64 Bit) VS: Visual Studio 2005 with Service Pack 1 .Net Framework: 3.5 (By default inbuilt in Win7 OS)   I am suspecting something bugging related to .Net framework 3.0 in Win7. We have one option in control panel to alter .NetFramework 3.5 under "Turn Windows Features on or Off" but there I can not see something related to 3.0 :-(.   Kindly suggest how can I load my existing project and how can enable option to create new wpf Projects.   I saw few solutions suggested by people on following Thread bt most of them related to Windows XP or Vista: http://social.msdn.microsoft.com/Forums/en/vswpfdesigner/thread/06cf7bca-982c-44cf-aec9-99cf399b3000 Do someone has solution for Windows 7 (64 bit OS)

Read an XML file, setting uname/pw, Accept, Content-Type

Hi; To read some REST XML data we need to set the username, password, and tell it for the http request Accept: application/xml Content-Type: application/xml Is there a sample anywhere showing how to do this? thanks - daveVery funny video - Reporting as a Metaphor

SQLServer 2008 Tools and SQL 2005 Cluster

I recently built a SQL Server 2005 cluster on the o/s Windows Server 2008 R2.  I have been attempting to connect to the cluster from my Windows 7 dekstop with my SQL Server 2008 Tool set.  I have been unable to attach to this cluster since its creation. The firewall is temp off, remote connections in the surface area configuration is set to pipes and tcp/ip and the Browser surface is up and running. I ran Wireshark against the cluster and I could see that there was UDP conversations for ms-sql-m (SQL Port) but that was as far as it would get.  I am using a named instance so not using 1433, but I do see the cluster offering up high RPC ports but the client never responds after the initial UDP response. When I noticed that there was a two way conversation taking place, I went to a seperate machine and fired up SQL Server 2005 Tools and I was easily able to attach to the cluster.  So my question is - Are there any known incompatibilities between SQL Server 2005 cluster services and SQL Server 2008 Tool set?  I can use my 2008 tools to attach to a non-clustered SQL Server 2005 w/o issue.   Error when attempting to connect: A network-related or instance-specific error occured while establishing a connection to sql server.  The server was not found or was not accessible.  Verify that the instance name is correct and the SQL Server is con

Could not load file or assembly 'Microsoft.SqlServer.BatchParser' or one of its dependencies

I got this problem when I tried to migrate one of my web deployment project from vs2005 to vs2010 on windows 7 machine. The exactly error message is like this: Could not load file or assembly 'Microsoft.SqlServer.BatchParser' or one of its dependencies. An attempt was made to load a program with an incorrect format.(description) ASPNETCOMPILER(file), myWebDeploy (project) I have installed all of suggested feature packs as suggested by others: SQLServer2005_ADOMD_x64.msi, SQLServer2005_XMO_x64.msi. Can somebody please help? Thanks a lot 

"Mixed mode assembly is built against version 'v2.0.50727'.... " issue and use custom config file

Hi, My Winform applilcation has used Microsoft.SqlServer.Management.Common namespace(assembly :Microsoft.Sqlserver.smo.dll/Microsoft.Sqlserver.ConnectionInfo.dll) and developed in .NET 4.0. Problem:Application is throw an exception when it tries to use above assembly reference methods. Full error text is shown below, "Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. " Error is resolved when we include "app.config" file with below code, <?xml version="1.0"?> <configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> </startup> </configuration> But, I need to keep configuration file as "renamed.config" and not to include app.config file as of the project requirement.I have set configuration file as "renamed.config" file using below code, //AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", "d:\\reanmed.config" ); I have also included <Startup> element in this "renamed.config" configuration file and removed the app.config file.But it raise me below error, it always expect app.config file with <Startup> element to resolve this iss

Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=

Hello to everyone. I have a .exe which uses the Server Management Objects(SMO) When I try it on my pc it runs without any problem. But on another pc it gives this error: Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified. I'm using SQL Server 2000 and for the application: Visual Studio 2005. Any idea would be very useful!! Thanks in advance!!

My Sql server 2005 Database in recovery mode for 3 -4 hours every day

Hi , Some of our Sql Server 2005 databases remain in recovery mode after midnight for almost 3 to 4 hours. So when my application access them error "Databse in recovery" and for same database this happens again and again every night. Please suggest why and how this can be solved?

Windows Mobile 5 , SQLSERVER/EXPRESS VB.Net 2005 Datareader NullException

Hi all, Recently I have started learning developing Smart Device Applications using .Net.Am using WM 5.0 SQLServer 2005 Express and VS 2005 (VB). In my application, I made a form with some comboboxes and other fields.In the form load am calling a function in my classfile.This function intends to fill the combobox.Please refer the codes below. 1 . The Form Load event in the Form Imports ShoppingList.DB Public Class frmMain Dim objDB As New DB Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load objDB.FillComboBox(cmbCat, "SELECT * FROM TABLE ORDER BY ID_PK") End Sub End Class 2 .Now the DB cls file Imports System Imports System.Data Imports System.Data.SqlClient Public Class DB Dim strCon As String = "Data Source=,1010;Initial Catalog=DB_Shopping;User ID=***;Password=****" Public Sub FillComboBox(ByVal cmbTarget As ComboBox, ByVal Sql_SP As String) Dim dbConn As New SqlConnection(strCon) Dim sqlCMD As New SqlCommand(Sql_SP, dbConn) Try dbConn.Open() Dim dr As SqlClient.SqlDataReader dr = sqlCMD.ExecuteReader() 'dr = sqlCMD.ExecuteReader(CommandBehavior.SequentialAccess) While dr.Read() cmbTarget.Items.Add(dr(0)) End While

Not always prompted for read-only or EDIT mode, when opening files with IE7, Sharepoint 3.0

Hello Everyone,   We use Sharepoint 3.0 and when I click on a document I get a pop up prompt that asks me whether I want to open the file in READ-ONLY or EDIT mode.   I use a machine with XP Pro that is running IE7.   A user called me today, also running IE7, and when he clicks to open a Sharepoint file he gets a different prompt - a simpler one that just offers OPEN or SAVE.   I don't care that his prompt looks different - the problem is that he is able to open the file, make edits, but then when he closes the file (using Excel) he isn't able to save his changes.   Excel only provides a save-as option for him.   This isn't a permission problem with his ID.   When I login to our Sharepoint 3.0 system as him, with his password (from my machine), I get the usual Read-Only / Edit prompt and when I open a file in EDIT mode I am able to save my changes with no problem.   Any thoughts on this?   Chris
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