Monday, March 15, 2010

How to reset the Identity Column in a table

hi Friends,
         In SQL Management Studio, When you use insert data in a table which has an identity column, The identity column automatically fill unique number for every row in that table. 
        When you want to delete the data from the table. The identity column will not reset and the identity number will not again start from 0.
        To solve this problem, pls execute the following query in the new query window for the selected db.
 
<!--  
 
 dbcc CHECKIDENT('TABLE_NAME',RESEED,0) 
 
-->        
By using this query, we can reset the identity column for the selected table.
 
Happy Coding

--
M.K.Kannan

Sunday, March 14, 2010

Service unavailable message in SharePoint

Hi

After creating a SharePoint web application, you try to access it and everything is working fine. But after few days, when you try to access the same web application, you get a page saying like SERVICE UNAVAILABLE.

You have made sure that IIS is up and running, everything seems to be fine. But you are not able to access SharePoint web application. The reason for this is as follows.

While creating the application, we need to configure a service account for it. Either it can be pre-defined like Network service or a configurable account. But if you have chosen a configurable account option, there lies the problem. When the password of that account get expired, you get the message SERVICE UNAVAILABLE.

To update service account credentials, you need to use SharePoint central administration. Click on Operations -> Service accounts link (under Security configuration). In the following page opened, select your application pool and update user name and password. Save the settings.

After this if you try to access your application, everything should work fine again.

Regards,
Prem

Friday, March 5, 2010

Problems on configuring existing SharePoint web application for SSL

Hi

I am Prem here, Kannan's colleague.
Just wanted to share a problem which happens in SharePoint web applications.

Configuring existing SharePoint web applications to work on SSL sometimes throws System.IO.FileNotFoundException. For example, consider the following scenario.
1. You have created a new SharePoint web application on some port say 3000 on a SharePoint server namely demoserver. The URL of your web application will be now http://demoserver:3000.

2. While creating this application using SharePoint central administration, you have not checked the option "Allow SSL" since you thought that you will be operating on http mode.

3. At a later time, you decide to switch to SSL. For that purpose, using IIS Management console, you assign a proper server certificate to your web application, enable SSL. The present TCP port is 3000. Now you configure the port 3000 for SSL and change TCP port to some other port number.

4. After doing these changes, you try to access your SharePoint web application like https://demoserver:3000

5. The SharePoint web application's home page will be loaded, but on clicking of links available in that web application might throw System.IO.FileNotFoundException.

In order to avoid this problem, you have to configure an internal URL using Alternate access mapping. For doing that, open SharePoint central administration and select the option Operations -> Global Configuration -> Alternate access mappings. On click of that, the list of web applications will be displayed.

Click on the link of your web application (In our example http://demoserver:3000). A page gets opened in which the URL points to http://demoserver:3000. Now change http to https and click on OK.

After configuring this, your links in SharePoint web application should take you to relavant pages without throwing System.IO.FileNotFoundException.

---------------------------------------------------------
If you plan to have SSL configuration for your SharePoint web application, it is better to configure it while creating the web application itself. Otherwise proper internal URL has to be defined using Alternate access mappings option to avoid problems.

I hope these hints help somebody. Thanks.

Regards,
Prem

Thursday, March 4, 2010

Pink Sample CSS code for changing themes



Pink Themes CSS:
<!--

/* Generated by Developer Tools. This might not be an accurate representation of the original source file */

BODY

{

TEXT-ALIGN: left;background-color:#f9b9b9; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT-FAMILY: Verdana; COLOR: #000000; FONT-SIZE: small; PADDING-TOP: 0px

}

A:link

{

COLOR: #a0410d; TEXT-DECORATION: none

}

A:visited

{

COLOR: #a0410d; TEXT-DECORATION: none

}

A:active

{

COLOR: #a0410d; CURSOR: hand; TEXT-DECORATION: none

}

A:hover

{

COLOR: #ffcc17; CURSOR: hand

}

A.bodyLink:link

{

COLOR: #a0410d; FONT-WEIGHT: bold; TEXT-DECORATION: none

}

A.bodyLink:visited

{

COLOR: #a0410d; FONT-WEIGHT: bold; TEXT-DECORATION: none

}

A.bodyLink:active

{

COLOR: #a0410d; CURSOR: hand; FONT-WEIGHT: bold; TEXT-DECORATION: none

}

A.bodyLink:hover

{

COLOR: #ffcc17; CURSOR: hand; FONT-WEIGHT: bold

}

P

{

LINE-HEIGHT: 1.4em

}

.title

{

TEXT-TRANSFORM: uppercase; FONT-FAMILY: verdana; COLOR: #a0410d; FONT-SIZE: large; FONT-WEIGHT: bold

}

HR

{

BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; HEIGHT: 2px; BORDER-TOP: #a0410d 2px solid; BORDER-RIGHT: 0px

}

IMG

{

BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px

}

UL

{

LIST-STYLE: disc url(Images/bullet.jpg) outside; FONT-FAMILY: verdana; COLOR: #000000

}

.menutextindent

{

FONT-SIZE: x-small

}

H1

{

COLOR: #c36c2d; FONT-SIZE: large

}

H2

{

FONT-FAMILY: Verdana; COLOR: #c36c2d; FONT-SIZE: medium

}

H3

{

FONT-FAMILY: Verdana; COLOR: #c36c2d; FONT-SIZE: small

}

H1

{

MARGIN: 0px; FONT-FAMILY: Verdana

}

H2

{

MARGIN: 0px; FONT-FAMILY: Verdana

}

H3

{

MARGIN: 0px; FONT-FAMILY: Verdana

}

H4

{

MARGIN: 0px; FONT-FAMILY: Verdana

}

TABLE

{

FONT-SIZE: 1em

}

TABLE.header

{

BACKGROUND-COLOR: #fde38f

}

TD.logo

{

TEXT-ALIGN: left; WIDTH: 184px

}

TD.title

{

TEXT-ALIGN: center; FONT-FAMILY: verdana; COLOR: #a0410d; FONT-SIZE: x-large; FONT-WEIGHT: bolder

}

TD.headerbar

{

BACKGROUND-IMAGE: url(Images/bar.jpg); TEXT-ALIGN: right; HEIGHT: 24px

}

TD.menu

{

BACKGROUND-COLOR: #a0410d; WIDTH: 184px; HEIGHT: 500px; VERTICAL-ALIGN: top

}

TD.footer

{

TEXT-ALIGN: right; FONT-FAMILY: Verdana; COLOR: #a0410d; FONT-SIZE: xx-small; FONT-WEIGHT: normal

}

 
-->
Copy and paste in css file. enjoy doing themes
--
M.K.Kannan..


Green Sample CSS code for changing themes



Green Themes CSS:
<!--

/* Generated by Developer Tools. This might not be an accurate representation of the original source file */

BODY

{

TEXT-ALIGN: left;background-color:#aee2c9; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT-FAMILY: Verdana; COLOR: #000000; FONT-SIZE: small; PADDING-TOP: 0px

}

A:link

{

COLOR: #00732e; TEXT-DECORATION: none

}

A:visited

{

COLOR: #00732e; TEXT-DECORATION: none

}

A:active

{

COLOR: #00732e; CURSOR: hand; TEXT-DECORATION: none

}

A:hover

{

COLOR: #cfc98b; CURSOR: hand

}

A.bodyLink:link

{

COLOR: #00732e; FONT-WEIGHT: bold; TEXT-DECORATION: none

}

A.bodyLink:visited

{

COLOR: #00732e; FONT-WEIGHT: bold; TEXT-DECORATION: none

}

A.bodyLink:active

{

COLOR: #00732e; CURSOR: hand; FONT-WEIGHT: bold; TEXT-DECORATION: none

}

A.bodyLink:hover

{

COLOR: #cfc98b; CURSOR: hand; FONT-WEIGHT: bold

}

P

{

LINE-HEIGHT: 1.4em

}

.title

{

TEXT-TRANSFORM: uppercase; FONT-FAMILY: verdana; COLOR: #00732e; FONT-SIZE: large; FONT-WEIGHT: bold

}

HR

{

BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; HEIGHT: 2px; BORDER-TOP: #00732e 2px solid; BORDER-RIGHT: 0px

}

IMG

{

BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px

}

UL

{

LIST-STYLE: disc url(Images/bullet.jpg) outside; FONT-FAMILY: verdana; COLOR: #000000

}

.menutextindent

{

FONT-SIZE: x-small

}

H1

{

COLOR: #0f9143; FONT-SIZE: large

}

H2

{

FONT-FAMILY: Verdana; COLOR: #0f9143; FONT-SIZE: medium

}

H3

{

FONT-FAMILY: Verdana; COLOR: #0f9143; FONT-SIZE: small

}

H1

{

MARGIN: 0px; FONT-FAMILY: Verdana

}

H2

{

MARGIN: 0px; FONT-FAMILY: Verdana

}

H3

{

MARGIN: 0px; FONT-FAMILY: Verdana

}

H4

{

MARGIN: 0px; FONT-FAMILY: Verdana

}

TABLE

{

FONT-SIZE: 1em

}

TABLE.header

{

BACKGROUND-COLOR: #eff0e8

}

TD.logo

{

TEXT-ALIGN: left; WIDTH: 184px

}

TD.title

{

TEXT-ALIGN: center; FONT-FAMILY: verdana; COLOR: #00732e; FONT-SIZE: x-large; FONT-WEIGHT: bolder

}

TD.headerbar

{

BACKGROUND-IMAGE: url(Images/bar.jpg); TEXT-ALIGN: right; HEIGHT: 24px

}

TD.menu

{

BACKGROUND-COLOR: #00732e; WIDTH: 184px; HEIGHT: 500px; VERTICAL-ALIGN: top

}

TD.footer

{

TEXT-ALIGN: right; FONT-FAMILY: Verdana; COLOR: #00732e; FONT-SIZE: xx-small; FONT-WEIGHT: normal

}

 
-->
Copy and paste in css file. enjoy doing themes
--
M.K.Kannan..



Blue Sample CSS code for changing themes

Blue Themes CSS:
<!--
 

/* Generated by Developer Tools. This might not be an accurate representation of the original source file */

BODY

{

TEXT-ALIGN: left; background-color:#b9d5f9; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT-FAMILY: Verdana; COLOR: #000000; FONT-SIZE: small; PADDING-TOP: 0px

}

A:link

{

COLOR: #be5057; TEXT-DECORATION: none

}

A:visited

{

COLOR: #be5057; TEXT-DECORATION: none

}

A:active

{

COLOR: #be5057; CURSOR: hand; TEXT-DECORATION: none

}

A:hover

{

COLOR: #eec4c6; CURSOR: hand

}

A.bodyLink:link

{

COLOR: #be5057; FONT-WEIGHT: bold; TEXT-DECORATION: none

}

A.bodyLink:visited

{

COLOR: #be5057; FONT-WEIGHT: bold; TEXT-DECORATION: none

}

A.bodyLink:active

{

COLOR: #be5057; CURSOR: hand; FONT-WEIGHT: bold; TEXT-DECORATION: none

}

A.bodyLink:hover

{

COLOR: #eec4c6; CURSOR: hand; FONT-WEIGHT: bold

}

P

{

LINE-HEIGHT: 1.4em

}

.title

{

TEXT-TRANSFORM: uppercase; FONT-FAMILY: verdana; COLOR: #be5057; FONT-SIZE: large; FONT-WEIGHT: bold

}

HR

{

BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; HEIGHT: 2px; BORDER-TOP: #be5057 2px solid; BORDER-RIGHT: 0px

}

IMG

{

BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px

}

UL

{

LIST-STYLE: disc url(Images/bullet.jpg) outside; FONT-FAMILY: verdana; COLOR: #000000

}

.menutextindent

{

FONT-SIZE: x-small

}

H1

{

COLOR: #dd9096; FONT-SIZE: large

}

H2

{

FONT-FAMILY: Verdana; COLOR: #dd9096; FONT-SIZE: medium

}

H3

{

FONT-FAMILY: Verdana; COLOR: #dd9096; FONT-SIZE: small

}

H1

{

MARGIN: 0px; FONT-FAMILY: Verdana

}

H2

{

MARGIN: 0px; FONT-FAMILY: Verdana

}

H3

{

MARGIN: 0px; FONT-FAMILY: Verdana

}

H4

{

MARGIN: 0px; FONT-FAMILY: Verdana

}

TABLE

{

FONT-SIZE: 1em

}

TABLE.header

{

BACKGROUND-COLOR: #fff3e0

}

TD.logo

{

TEXT-ALIGN: left; WIDTH: 184px

}

TD.title

{

TEXT-ALIGN: center; FONT-FAMILY: verdana; COLOR: #be5057; FONT-SIZE: x-large; FONT-WEIGHT: bolder

}

TD.headerbar

{

BACKGROUND-IMAGE: url(Images/bar.jpg); TEXT-ALIGN: right; HEIGHT: 24px

}

TD.menu

{

BACKGROUND-COLOR: #be5057; WIDTH: 184px; HEIGHT: 500px; VERTICAL-ALIGN: top

}

TD.footer

{

TEXT-ALIGN: right; FONT-FAMILY: Verdana; COLOR: #be5057; FONT-SIZE: xx-small; FONT-WEIGHT: normal

}

 
-->
Copy and paste in css file. enjoy doing themes
--
M.K.Kannan..

How to use Themes using CSS

First create a folder named "StyleSheets" and then create css files with blue, pink, green and grey base themes.

<!--

<

asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" AutoPostBack="True"><asp:ListItem Value="Blue">Blue Themes</asp:ListItem><asp:ListItem Value="Green">Green Themes</asp:ListItem><asp:ListItem Value="Pink">Pink Themes</asp:ListItem><asp:ListItem Value="Grey">Grey Themes</asp:ListItem></asp:DropDownList>

-->

Then in the master page, while giving the link to the stylesheet, type as follows

<!--<

link rel="stylesheet" type="text/css" href = "../StyleSheets/<%=Session["Theme"] != null ? Session["Theme"].ToString():" default1.css"%>" />-->

Then in the dropdown changed event, please give the session[themes] to the stylesheet name and extension. as follows

<!--

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)

{

if ((DropDownList1.SelectedValue == "Blue"))

Session[

"Theme"] = "default1.css";

else if ((DropDownList1.SelectedValue == "Green"))

Session[

"Theme"] = "default2.css";

else if ((DropDownList1.SelectedValue == "Pink"))

Session[

"Theme"] = "default4.css";

else if ((DropDownList1.SelectedValue == "Grey"))

Session[

"Theme"] = "default5.css";

}

-->

Thats all. run the application, u can see the changes of themes...... all the best

try it.

this will purely work in all ASP.NET application and not supported in sharepoint.

regards


--
M.K.Kannan..

HTML/JAVASCRIPT BLOG

You can find the help for html and javascript codes

Any Doubts Contact my Mail-ID:
kannan.mkv@gmail.com