.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

Changing to Sinle user mode

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :Sql Server

My database is in Emergency mode... I'm trying get back to single user .... but it says....  Database state cannot be changed while other users are using the database <DBNAME>

but when check with sp_who.... there is no active processors......

The command i applied is...... sp_dboption 'DBNAME', 'single user', 'true'


Please Help... tks

View Complete Post

More Related Resource Links

Changing user domain

Hi, We have our sharepoint 2007 entreprise farm importing users from two different AD. Let's say 'potato' and 'orange'. We have mysite creation activated in our farm. We have to change one user from potato to orange. The user domain is not in the mysite url of the user. We have http:\\...\personal\fLastName. Questions: 1- How can I change potato\fLastName to orange\fLastName?    We wante to disable potato\fLastName AD account and then create orange\fLastName.     Does it impact profile AND mysite? 2- What are the impact on document history?   Will I still be able to see what potato\fLastName changed or it will show orange\fLastName? Thanks.

SQL 2008 R2 clustered instance does not start in single user mode

Hi I am testing the startup of a SQL 2008 R2 clustered instance (Windows 2008 R2) using single user mode but it fails with : Error: 17058, Severity: 16, State: 1. initerrlog: Could not open error log file ''. Operating system error = 3(The system cannot find the path specified.) - I am running the following command from the default sql installation : C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL01\MSSQL\Binn>sqlservr.exe -c -m -s SQL01 - The cluster service on the passive node has been shutdown. - The SQL Server and SQL Agent services have been set to offline in Failover Cluster Manager. Any assistance greatly appreciated. Regards, PK    

Changing a users role with RadioButtons (User is always in single role)

So I have a set of 5 radio buttons corresponding to the roles a user can have on my website.  I have been successfully able to retreive what radio button needs to be checked for the role the user is currently in... string username = Request.QueryString["username"]; // Get Access Levels and populate radio buttons. if (Roles.IsUserInRole(username, "Banned") == true) { RadioButton4.Checked = true; } if (Roles.IsUserInRole(username, "Member") == true) { RadioButton1.Checked = true; } if (Roles.IsUserInRole(username, "FOB_Employee") == true) { RadioButton2.Checked = true; } if (Roles.IsUserInRole(username, "FOB_Administrator") == true) { RadioButton3.Checked = true; } if (Roles.IsUserInRole(username, "Webmaster") == true) { RadioButton5.Checked = true; } My problem is I do not know what to do with the actual procedure of changing the roles based on the new radio button selection.  I have tried many different methods, including using if statements to check if the user is currently in the role, remove him/her from that roll, and then add the user to the newly selected role.  It appears, from my testing, that you can not

Put outer-gridview in non-Edit mode when user edits inner-Gridview

using vb.net/asp.net 2005.(sorry last post I had the grids reversed, what I meant to say is this:I have an outer gridview I'll called "Outer" and an inner-gridview inside that I'll call "inner".There are times when the user will put Outer into edit mode and then put Inner into edit mode and change a value in Inner.  The user is not supposed to be able to do that.So when the user wants to edit Inner I need to change the edit mode of Outer so that Outer is Not editable.   EX: I want to do something like this but not sure in which event of outer to do it:'event fired when user puts inner gridview into edit mode Protected Sub Inner_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles Inner.RowEditing 'put outer gridview into non-edit mode Outer.EditIndex = -1 End Sub Does anyone know how to do this, is this the right event?  Also I assume I have to rebind the gridview?thanks,MC

Parameter value filter based on user in SSRS (SharePoint Integration mode)


Hello..we have a reuirement where we have to filter the parameter value in the drop down based on the user who is accessing the report. We have form and Windows authenication enabled in the SharePoint site (some users will be from inside the network using windows and some will be accessing the site using internet using the Form Authentication).

Please let me know what would be the best way to handle this reuirement? Do we need to create a separate table  and store the User Information along with the parameter values they have access to, pass the userid from Report to db and then fileter the records using this table? OR Can we create a SharePoint List to maintain the user access information and then directly fetch the user information from the list using T-SQL to filter the records?

Please let me know your suggestion...


My user controls stopped working in Design mode! Why?


I have a few user controls that I have been using for months but now whenever I open a page in Blend that uses one of the controls I get an invalid xaml error. The project still compiles and runs and behaves just like it's supposed to but I can't edit xaml in Design view because of this error.


In the page I have

<local:ACAVariableWidth x:Name="CIDCloseButton" HorizontalAlignment="Right" Margin="0,0,17.54,15" VerticalAlignment="Bottom" Width="174" Height="89" MouseLeftButtonDown="callerID_close" Text="Close"/>

The error is: The member "Text" is not recognized or is not accessible

In the user control xaml I have:

		<StackPanel x:Name="TopSP" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Center" Height="76" d:IsLocked="True">
			<TextBlock x:Name="ACATB" Margin="8,8,8.5,9.5" FontFamily="APHont" FontSize="32" Padding="5,0" Foreground="White" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding ElementName=UserControl, Path=Text}" d:IsLocked="True">
					<DropShadowEffect Direction=&

Disappearing "Exit Edit Mode" and "Welcome User XYZ"


Kind of a mystery problem here. I have been building a couple of Sharepoint sites for our teams. Nothing fancy.

The mystery is that the symptoms are slightly different, depending if one uses a generic public logon, or a discrete user logon.

Generic Logon - "Welcome User XYZ" (located at top right) is gone. Site Actions is completely gone.

Discrete User Logon - "Welcome User XYZ" is visible. "Site Actions" (located upper right, below "welcome") is visible, but when clicked on, page goes to edit mode, but "Exit Edit Mode" is not visible.

Viewing the main page (Default.aspx) gives a different page, depending on whether one is logged on as a generic user or a discrete user.

It is almost as though there are two different versions that are running unsynchronised, depending on the logon.

  • Generic Logon renders Version A.
  • Discrete Logon renders version B.

A month or so ago, I was on some Sharepoint forum hunting some code snippet to make the quick launch have collapsible menus. It recommended going through an evolution of making a copy of "default.master" and renaming one of the copies "olddefault.master" as a back-up and inserting the code there. Tried it. Didn't work. Thought I cut the offending code out but a comparison

changing Asp.net Gridview's cell from Label to edit mode in code behined file


 Hi all,

In my asp.net application i'm using gridview to which i'm binding data dynamically by writing a select query in code behined file (all column's are autogenerated) now i want to change gridview cell to edit mode from label to textbox or dropdown on clicking of gridview's cell.How can i achive this in code behined file.

thanks in advance

Blog - Changing the URL of user account on posts.

When a post is created on a SharePoint 2010 blog, the title of the post and author is displayed. When clicking on the authors name it brings up the userdisp.aspx with all their info. I need to redirect them to another page that displays the author's bio instead.

Someone told me that I need somehow rewrite the URL inside the div.ms-PostFooter tag. I have absoutely no knowledge of Javascript. Can someone please help??



User profile sync failing after changing username when another administrator got married recently.

I changed the username in Active Directory for the administrator who set up most of our Sharepoint 2010 server and now neither she nor I (as domain admin) can manage library settings, services on farm, or a number of other places where apparently sharepoint relies on user profile sync to succeed to grant privileges.  Checking back in the logfiles, it would appear that sharepoint profile sync hasn't been working since the last cumulative update but no one noticed (I don't adminster the server) until the sharepoint admin user person got married and their username (and display name) changed.  Since then, many links are broken in both central admin and all other sites.  The error is always the following (the date/time changes obviously):  "


User cannot be found.


Troubleshoot issues with Microsoft SharePoint Foundation.

Correlation ID: a13766dc-6604-46ef-9abc-e5daade

User mode name \\.\PhysicalDriveX mapping to kernel mode name \Device\HarddiskX\DRX


Hi all,

Using WMI api i got the list of all the Hard disk on my system and for each hard disk i got the Device ID which is of format "\\.\PhysicalDriveX" . This Device ID is i believe User mode name for that Hard disk, i wanted to get corresponding Kernel mode name for that Hard disk which is of format "\Device\HarddiskX\DRX". Is it the case that the value X is same for user and kernel mode ? If i have a Hard disk with Device ID "\\.\PhysicalDrive0", is it true that it corresponding kernel name will be "\Device\Harddisk0\DR0" or can it be something else other then 0 ?


coming out of single user mode



How to come out of single user mode in sql server


Database Corrupted - Can't get db in single user mode

I have two SQL 2008 R2 databases running on a 64-bit development Machine :
I have created Synonyms in MyDatabase (Table1, Table2, Table3) for three tables in the IMS database.
I am experiencing very poor performance using these Synonyms from my application so I am trying to troubleshoot the problem.
I tried to run "DBCC CHECKDB (IMS,  REPAIR_ALLOW_DATA_LOSS)" by performing the following steps
  1. Used Services to stop the processes (Instance, Agent, Browser, Integration Services 10.0, VSS Writer)
  2. Ran cmd.exe "As Administrator"
  3. cd C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\Binn
  4. ran sqlservr.exe -m -s SQLEXPRESS (output says it started in single user mode)


  1. Ran cmd.exe "As Administrator"
  2. cd C:\Program Files\Microsoft SQL Server\100\Tools\Binn
  3. ran sqlcmd.exe -S D

User name is changing


Hi All,

         User1 logs in with "User1" as UserName with his password. After it, he fills some form and clicks on SAVE button. After it record saves successfully, but in LoginName control shows some another user name who already logs in, on another machine. [I have number of users]

I checked the web.config file.. The access permissions are defined properly... then what is the reason of it? Everytime User name is changing randonly. So that I am unable to genrate reports.

anybody know this?



SQL Server 2000 Database in "single user mode"


Hi all,

I've an old production database server with SQL Server 2000 SP4, that runs from 6 years. Now sometimes I find that the production database goes in "single user mode". Why? My error logs don't help me.

Is realtime SQL Server Replicated database usable realtime (not offline / single user mode)


Is SQL Server replicated (destination) database replicated by SQL Server Replication fully usable? Meaning it's not just for Disaster Recovery but is fully usable from various say BI / Reporting purposes.

In the essence it is exactly same as other replication engines and the destination database is very much usable and not just offline / single user mode.



SMO Database in Single User mode issues


I am trying to use the SMO library and setting the single user mode. Here is a simple example illustrating my issue.

The below code will fail the first time. Saying "Invalid object name TestTable". Eventhough that table does exist and so does the DB. However, if you run it again (now the DB is already in single user mode) everything works fine. Also, if you remove the code that alters the db user mode everything works fine. I am assuming the problem must exist with the single user mode and utilizing the correct db connection. I have tried flipping the AutoDisconnectMode and NonPooledConnection but that hasn't help. Any help would be appreciated.

Sample code

SqlConnectionStringBuilder sb = new SqlConnectionStringBuilder(); 

sb.Password = "P@ssword!"; 

sb.UserID = "testuser"; 

sb.DataSource = @".\mssql2008"; 

sb.InitialCatalog = "TestDB"; 

ServerConnection serverConn = new ServerConnection(); 

//serverConn.AutoDisconnectMode = AutoDisconnectMode.NoAutoDisconnect; 

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