Thursday, September 23, 2010

Comma Seperated Values from Tables in SQL

Hi Everyone,
This blog helps you to display the table column value to comma seperated values.
First we have to select the table and before the column name, kindly add a ','.
Then keep the select as inner query and use substring in the select query.
This substring will need 3 parameters - Expression,Start-Position,Length.
Give this as it is! the value 2 has given as start position to remove the first comma present in the final list.
 
 
SELECT SUBSTRING(
(
SELECT ',' +
s.Name
FROM
HumanResources.Shift s
ORDER BY
s.Name
FOR XML PATH('')),2,200000) AS
CSV
GO


By this way, We can make the table to csv..
 
Regards 
M.K.Kannan..

Wednesday, September 22, 2010

Type Name for Object Datasource in GridView in ASP.NET

Hi,
The Object Datasource control used for the gridview needs a TypeName for the control to get the value from the backend.
When we have a seperate project for ASPX and ASPX.CS files, The type name can be given as the Project name of the ASPX.CS Class library.
But when we create a website or webapplication, The ASPX and ASPX.CS will be in the same project.
That time, the TYPENAME  will not accept the current project name.
For that we can assign the TypeName value in the codebehind as follows
 
-----------------------------------------------------------------------------------------------------------------
 
string typeName = this.GetType().AssemblyQualifiedName;
objectDSAccountList.TypeName = typeName;
-----------------------------------------------------------------------------------------------------------------
 
By adding the above code in the code behind.
We can add an object datasource to a gridview or a repeater to use the paging concept for getting data.
By using this Object Datasource. We can take only a limited amount of records to be taken from the database w.r.t page size.
 
To use Object Datasource, See my blog posted on June 2009 for further reference.
 
Thank YOu
Yours
Kannan.K.Mangudi

Friday, June 25, 2010

"The best moments in life"

1. All days are Holidays...

2. Laughing till your stomach hurts...


3. Enjoying a ride down the countryside...


4. Listening to my favourite song on the radio...


5. Going to sleep listening to the rain pouring outside...


6. Getting out of the shower and wrapping myself in a warm, fuzzy towel...


7. Passing my final exams with good grades...


8. Being a part of an interesting conversation...


9. Finding some money in some old pants...


10. Laughing at myself...


11. Sharing a wonderful dinner with all my friends...


12. Laughing without a reason


13. "Accidentally" hearing someone say something good about me...


14. Watching the sunset...


15. Listening to a song that reminds me of an important person in my life...


16. Receiving greeting cards from juniors in college.


17. Staying in dark cold place.


18. Having a great time with friends...


19. Seeing the one you love happy..


20. when Girls like my smile...


21. Visiting an old friend of mine and remembering great memories....


22. Hearing someone say "i love u"....


Have you had these moments in your lives?

--



M.K.Kannan..

Tuesday, April 20, 2010

Problem in running a webapplication in IIS


Hi Friends
If you have installed Visual Studio before installing IIS. There will be problem in running a web application in IIS.
To solve this problem ie we have to reset the aspnet regiis to run a webapplication in IIS.
 
The steps as follows
1.     Go to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
2.     Copy the address "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727"
3.     Open the command prompt (ie)  start->run->cmd
4.     Type  " cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" or paste after typing cd and then press enter to go to that place.
5.     Type "aspnet_regiis -i"  and press enter
6.     It will take a minute to reset the aspnet regiis process
7.     Now try to restart the IIS by iisreset in cmd
8.     Now run your webapplication in IIS.
 
The problem will be solved.
This is the solution for the problem in running the webapplication in IIS.
 
Happy Programming.
 
regards
M.K.Kannan..

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..

Tuesday, February 2, 2010

Sharepoint Site Backup and Restore

Sharepoint Site Backup and Restore
 
here's how I made this work:

1. Create a back-up (you will need to substitute in your path names)
Navigate to:     C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
run:                  stsadm.exe -o backup -url http://sp1/v1 -filename backup.dat

2. Go to the sharepoit Admin site, and add a new content Database (Now new sites you create will use this new content DB)

3. Create a new site... say "http://sp1/v2"

4. Run "restore" from the Commandline:
stsadm.exe -o restore -url http://sp2/v2 -filename backup.dat -overwrite

or else use sharepoint designer to export and import the site..
 
 
--
M.K.Kannan..

Friday, January 15, 2010

IEEE project titles


 
Wireless Sensor network for security system.
Energy monitor and group monitoring using smart wireless sensor.
Remote energy monitor using GSM or GPRS

GPS based navigation system for people
Remote monitoring of Moisture Control - Irrigation Purpose
Interconnecting sensor , PLC and web for real time applications

--
M.K.Kannan..
+91-9245822755

HTML/JAVASCRIPT BLOG

You can find the help for html and javascript codes

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