Monday, June 7, 2010

How to redirect to the login page when using access rules in membership provider

"forms loginUrl="pages/Login.aspx"  name=".ASPXFORMSAUTH"" Add this entry to the Web.Config inside the tag
authentication mode="Forms" .

Thursday, March 25, 2010

Can not restore sql server 2005 Backup

If restoring a .bak file to a new database fails then go to these steps.

Create a new database using this script.

 USE [master]
GO


CREATE DATABASE [Test] ON PRIMARY
( NAME = N'Test', FILENAME = N'C:\Test.mdf' , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'Test_log', FILENAME = N'C:\Test_log.ldf' , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO

Stop sql server service.

then replace the newly created  .mdf & .ldf files with your older .mdf & .ldf files.

Stop sql server service. 

Refresh  your server tree.


Then you are done...

Tuesday, March 23, 2010

Free Sharepoint Discussion Forums

http://www.sharepointjoel.com/Lists/Posts/Post.aspx?ID=234

http://weblogs.asp.net/soever/archive/2005/03/04/385523.aspx

http://www.datasprings.com/Products/SharePointWebParts/MOSSForums.aspx

http://spforums.codeplex.com/releases/view/53

How to remove the “Title” column from a SharePoint Custom List

Have you asked yourself the question: How do I remove the ‘title column’ from a Sharepoint list? It can be annoying trying to figure out how to remove this column from default lists. Often, site admins want their audiences to click on “New Item” in a Sharepoint list and not have to fill out the default ‘Title’ column content type.


I found a great article while surfing internet.This show you how to remove the
"Title" filed from a custom list

Thursday, February 4, 2010

Change Modified Field of Sahrepoint List Using Object Model in c#

When created items in SharePoint via the object model, you can convert a readonly property of that field to be false in order to allow you to set the value of that field. This is particularly useful for setting created and modified dates (all SharePoint lists retain these).

// get the list and set modified property to allow writing
SPWeb web = new SPSite("http://url/to/web").OpenWeb();
SPList selectedList = web.Lists["listname"];
selectedList.Fields["Modified"].ReadOnlyField = false;
selectedList.Fields["Modified"].Update();


// set the item
SPItem newItem = selectedList.Items[0];
newItem["Modified"] = DateTime.Now;
newItem.Update();

// Set readonly back to true
selectedList.Fields["Modified"].ReadOnlyField = true;
selectedList.Fields["Modified"].Update();

Wednesday, February 3, 2010

Firebug has a lite version that can be used in any browser! Obviously it isn’t as functional as the Firefox plug-in, but it helps out none the less. Some things you are normally used to doing in firebug will not be as easy, such as disabling CSS rules and the handy inspect is less functional.

There are 2 ways to activate Firebug lite:

 1. Including an external JavaScript File
 2. Using a bookmarklet

All you have to do is add the following to your head as a javascript
script type='text/javascript'
src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'

Wednesday, January 6, 2010

How to use decimal in SQL Server

decimal and numeric (Transact-SQL)

Numeric data types that have fixed precision and scale.

decimal[ (p[ , s] )] and numeric[ (p[ , s] )]

Fixed precision and scale numbers. When maximum precision is used, valid values are from - 10^38 +1 through 10^38 - 1. The ISO synonyms for decimal are dec and dec(p, s). numeric is functionally equivalent to decimal.

p (precision)

The maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point. The precision must be a value from 1 through the maximum precision of 38. The default precision is 18.

s (scale)

The maximum number of decimal digits that can be stored to the right of the decimal point. Scale must be a value from 0 through p. Scale can be specified only if precision is specified. The default scale is 0; therefore, 0 <= s <= p. Maximum storage sizes vary, based on the precision.