.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

Change the default users for a new database?

Posted By:      Posted Date: October 16, 2010    Points: 0   Category :Sql Server
Is there any way to customise the default users that have access to a newly created database? I have an Active Directory group that has been granted logon rights to the SQL server, but I need it to have read/write access to any new databases that are created on the server. I don't want to use the Mgmt Studio to grant the permissions. This is because we have an app that creates the databases, but it doesn't set the security. I want an easy way for the security to be granted.

View Complete Post

More Related Resource Links

MS SQL Server: Disconnect Users From Database - Kill User Session

If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

How to change the default page base class?


I've tried setting the <pages pageBaseType="DynamicWebPage" /> value in web.config, but when I response.write out the page type, I'm still getting Microsoft.WebPages.WebPage.

I'm simply trying to sub-class WebPage and add some additional functionality such as a dynamic PageData dictionary similar to Phil Haack's dynamic ViewData dictionary.



how to change default menu tab in master pages?



i have 5 tabs in my master page application. how can i make 2nd tab as default?

any ideas?


Is it possible to change the title bar background and the font style on default template?



Is there any way to change the default top link /title bar picture and the fonts of the title without breaking anything in the layout/structure?

I have changed the theme to Obsedian and I would also like to change the picture of the title bar of this theme and also the font/style of the title, top link bar, menus..etc. Is there a way to do this?

Please note: I am using WSS 3.0 and I am not the Administrator of the sharepoint. I am only the site admin of some sites on this sharepoint. I can do some basic customization using SPD.

Basically, what I am trying to do is that I want to set up a sharepoint site, however I want to make it NOT look like a sharepoint site.Well I know this is possible, but for my case it might be just partially possible due to the limitation that I am not the Site collection admin and hence I do not have direct access to the server itself.

What I want is to hide most of the sharepoint links/menus/bars, etc and use my own buttons/hyperlinks etc .. for user to navigate on the sites.

Thanks in advance for your help/advices.



How do I change the default HTML code for a collection of lists and views


I have modified the html display code of some lists and content query web parts in SharePoint designer.  This works well when modifying a few lists, but I have many lists and different views with these many lists.

Is there a way to modify the template code for a site so that all my lists, views and CQWPs display identically with my modified code?  Managing these individually is not practical.

Change database fields automatically according to date

Hi, I'm currently developing a software application for my client. Part of the project is to keep track of his stock's shipping status. The client must insert the stock's pick-up date, expected time of departure (ETD) and expected time of arrival (ETA). The stocks will be called out using Grid View and the status, being one of the keys of the database, will be shown. Before the current date reaches pick-up date, the status must show "in warehouse", and after the current date reaches pick-up date and is before ETD, status must show that its "on the way to the port", and after ETD and before ETA, "in freight", and finally after ETA, "arrived". What datatype should I use for the database and where should I program it so that it changes automatically accordingly ?

Change SSP and Search database names

While creating SSP, besides the Admin site and MySite content databases, two more databases get created. They are usually named MySSP_DB and MySSP_Search_DB. If later we have a need to change these database names, what is the procedure? Thanks

Change Default Column Value programatically

On a Document Library Settings Page, there is a new setting in SP2010: "Change Default Column Value". Changing the default value of the Field is different from this value. Does anyone know what this value is and where to set it programatically? Also, what libraries is this setting available on? This code updates the field's default value but not the property mentioned above: SPField field = list.Fields["Column"]; field.DefaultValue = "DefaultValue"; field.Update(); Thanks!

how can I change default errormessage for invalid price

I have:[Required(ErrorMessage = "Price is required.")]public decimal price { get; set; }How can I change default message for invalid price - I would like to change default error message "The value '45,8asasa' is not valid for Price.".

Change password for FBA users in claims setup not working as expected

Hi, I am trying to add a standard asp:changepassword control for external users. In the previous 2007 sharepoint environment this control was working "out of the box". I am pretty sure what is wrong as well,- but not sure how to fix it. A workaround that makes me able to change password is as follows: in the asp - control, I have added the option DisplayUserName="true" Then in the actual web-page, i can see that my username is: 0#.f|acaspnetsqlmembershipprovider|xxxxxx and not xxxxxx as i would excpect, as i use xxxxxx to log in. Editing the username to just xxxxxx makes the changing of password work, but this solution is not really nice to deploy to the normal end-users.. Any suggestion on how to make the username right? I've tried to set the username using the option UserName="<%=SPContext.Current.Web.CurrentUser.LoginName%>", but it does not seem to evaluate..  

change password from the database

I have created login page(login.aspx) using login cotrol, now my lead asked me to provide an option "Change Password" so that end-user can change his password any time.I have created different form named as ChangePassword if you click lable ChangePassword on login.aspx page a pop-up window appears with changepassword control.how can i make this work using same(login) table. i searched around for code around i did not find.I used this link to create login page http://www.vbdotnetheaven.com/UploadFile/raj1979/VBLoginControl07242008114552AM/VBLoginControl.aspx Can any one help me,thanks

Why is it that this code updates my sql database with the default EditBox text?

Any help is appreciated. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using MySql.Data.MySqlClient; public partial class _Default : System.Web.UI.Page { TextBox EditBox = new TextBox(); TableRow[] NewRows = { new TableRow(), new TableRow() }; TableCell[] NewCells = { new TableCell(), new TableCell() }; string ID; protected void Page_Init(object sender, EventArgs e) { } protected void Page_Load(object sender, EventArgs e) { var Connection = new MySqlConnection("Server=localhost;Database=site;Username=root;Password=root"); var Command = new MySqlCommand("select * from news", Connection); Connection.Open(); var Reader = Command.ExecuteReader(); while (Reader.Read()) { ID = Reader.GetString("ID"); string Title = Reader.GetString("Title"); string Text = Reader.GetString("Text"); foreach (TableRow Row in NewRows) { NewsTable.Rows.Add(Row); } NewCells[0].Text = Title; NewCells[1].Text = Text; NewCells[0].Font.Bold = true; NewCells[0].Font.Underline = true; NewCells[0].Font.Size = Fon

Change the Default Date in the Date Picker Control

Hi, I have a WPF Datagrid in which one of the columns is a Date Column. So i have used a DataTemplateColumn as Follows     <my:DataGridTemplateColumn CellTemplate="{StaticResource EffDateDateTimePickerControl}"   CellEditingTemplate="{StaticResource addrEffDate}" Header="Effective Date"/> And in my Resource File i have written the following code: Style   TargetType="{x:Type my:Calendar}" x:Key="CalenderControlTemplate">     <Setter Property="Template">     <Setter.Value>     <ControlTemplate TargetType="my:Calendar" >     <my:CalendarItem Name="myCalendarItem"   Background="White"   BorderBrush="Black"   BorderThickness="1"   VerticalAlignment="Center" />     </ControlTemplate>       </Setter.Value>     </Setter>     </Style>       <DataTemplate x:Key="EffDateDateTimePickerControl">     <Label x:Name="lblEffDate" Content="{Binding effectiveDate,Mode=TwoWay}" ></Label>     </DataTemplate>     <DataTemplate x:Ke

In a group calendar, can items be made visiable to all users by default without adding them as atten

Well the title says it all really. We have a functioning sp 2010 site, setup this weekend, that's working great so far.  Primarily its being used for the company manual and procedures (a wiki site).  Search is working well and so on. I added a calendar with the intention of showing key company activities, plus holiday information and who's out at meetings.  We're a small company and this is unlikely to get ridiculously except on exceptional days. As it stands, when i create an item (for example someone out for a weeks holiday) unless another user adds one of the 'attendees' of the holiday event to the calendar it doesn't show up.  If I add all users as attendees then they can all see it by default. However, if I show that our chairman is attending a meeting at a client, then I can't explicitly say that the chairman is an attendee because for everyone to see it, they have to be attendees as well. I nsoed around a little and thought target audiences might be the way to go.  I configured all users and manager relationships, compiled the audience (it shows the right number of users).  However, if I setup a meeting with the chairman as an attendee, and the whole company audience as the target audience, then people still can't see it. Back to square one. So, is there an actual answer to this?  A different type of calendar, a query that

Database Service number does not change

I notice when I check to make sure the SP3 took I still see SQLExpress\9.0.3042 instead of 9.0.4035 for SP 3. The server management studio changed has to 9.0.4035 but not the database. Can some explain this?

how to change the web application Database connection form Windows authentication to SQL Server acco

Hi, I have a web application created and Database connection authentication was given as Windows authentication. how can i change it to a SQL server account in MOSS 2007. Thanks in advance.

Change Database and Log Properties

Hello, I have the following T-SQL code when creating a database: create database DBFA on primary ( name = 'DBFA_Data', filename = 'DBFA_Data.mdf', size = 40MB, maxsize = 2GB, filegrowth = 20MB ), log on ( name = 'DBFA_Log', filename = 'DBFA_Log.ldf', size = 20MB, maxsize = 200MB, filegrowth = 10MB ) This is working fine when creating a new database. But how can I define this properties but on a existing database? Thanks, Miguel
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