How to use Trim() Function in SQL server 2005 ?


Tuesday, November 24, 2009

There is no perticular function like Trim in SQL server but you can achieve Trim like functionality by doing Left Trim and Right Trim, to get complete trimed Text.

LTRIM is used to : Trim Text form left hand side or in other word remove space form left hand side.
RTRIM is used to : Trim Text from Right hand side or in other word remove space form Right hand side.

Example :

You can Use this query directly in SQL Server 2005

SELECT    *
FROM view_rapdata_full_member_pull
WHERE LTRIM(RTRIM(First_Name)) +' '+ LTRIM(RTRIM(Last_Name))
like '%Rajesh Singh%'
or
LTRIM(RTRIM(Last_Name)) +' '+ LTRIM(RTRIM(First_Name))
like '%
Rajesh Singh%'


You can Use this query in C# code to make search.

SELECT    *
FROM view_rapdata_full_member_pull
WHERE LTRIM(RTRIM(First_Name)) +' '+ LTRIM(RTRIM(Last_Name))
like '%" + txtsearch.Text + "%'
or
LTRIM(RTRIM(Last_Name)) +' '+ LTRIM(RTRIM(First_Name))
like '%" + txtsearch.Text + "%'


Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

How to stop right clicking of mouse on my web page ?


Monday, November 23, 2009

You can just put single line code in body tag, to stop copy your website content and copy your image.

Here is the code

<BODY oncontextmenu="return false">


Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

How to make search in google image swirl ?


Saturday, November 21, 2009

As the face of the world is changing, with respect to that, the technology is also changing and different technology are been found to cope up with this changing world. one of such change is in the world of image search.

Once again google has strike the world with the new technique to make your image search, this is called google image swirl.

Please try this, it will give you different experience to search image in google.


make image search in google image swirl


I have tried this and Please follow steps to find, how to make search in google image swirl search.

The main logic of this google swirl search is, there is only one parent and this parent has so many child.

Try out demo of google image swirl.


Here i have made image search for keyword "india" and i got this page


Parent images


then i have clicked on one of the image in the above list.

Child 1 images


like wise i have clicked on one of the child of the parent.

Child 1.1 images


Child 1.1.1 images


Child 1.1.1.1 images


To return back to parent, click on the parent images shown back to the search page.then you will return back to

parent.

Parent images

Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

Open Google Adsense ads in new Window safely


Thursday, November 12, 2009

I read on many forums about how we can open Google Adsense Ads in new window. This is not possible directly through Adsense but if you use Google Ad manager you can easily achieve to Open Google Adsense in new Window safely.


Import your Adsense Code into Google Ad manager and have the option in Google Ad manager to open urls in new Window. Now replace your existing Adsense code with the Google Ad Manager code and you would see that your Adsense Ads now Open in a new Window. Do not try seeing it on your own ads units but you can verify it. If you see a special icon near the bottom left of your ad units they would open in new window like in the figure below.


Open Google Adsense in new Window safely


This should be pretty safe as both AdManager and Adsense are Google product and well integrated with each other.



To view demo of such site on which this techique is used, Please visit Demo and click on the ads on this website.

Simple way to add title, Meta and description tags in child page of masterpage in C#


Monday, November 9, 2009

Create visual studio project and Add two Masterpage.aspx and test.aspx in it.

Open Masterpage.aspx and add this below code in Head tags.

<head id="head1" runat="server">
<title>Master Title</title>
<meta id="Keywords" runat="server" content="" />
<meta id="Description" runat="server" content="" />
<meta name="language" content="english, EN" />
<meta name="revisit-after" content="3 Days" />
<meta name="ROBOTS" content="all" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>


then open test.aspx page and add below code in code behind in page load

protected void Page_Load(object sender, EventArgs e)
{
HtmlHead masterhead = (HtmlHead)Master.FindControl("head1");
masterhead.Title = "test title";

HtmlMeta Keywords = (HtmlMeta)Master.FindControl("Keywords");
Keywords.Name = "keywords";
Keywords.Content = "test keywords,welcome to test keywords";

HtmlMeta description = (HtmlMeta)Master.FindControl("Description");
description.Name = "Description";
description.Content = "This is the test page description";
}


by using above method, you can easily add title, Meta and description tags in child page of masterpage in C#.

Output of test.aspx, you can right click on browser and view the source, you will find all the meta keyword added in this page

test.aspx

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="ctl00_head1">
<title>test title </title>
<meta id="ctl00_Keywords" name="keywords" content="test keywords,welcome to test keywords" />
<meta id="ctl00_Description" name="Description" content="This is the test page description" />
<meta name="language" content="english, EN" />
<meta name="revisit-after" content="3 Days" />
<meta name="ROBOTS" content="all" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<form name="aspnetForm" method="post" action="test.aspx" id="aspnetForm">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEwMDUyNjYzMjgPZBYCZg9kFgICAQ9kFgQCAQ8WBB4EbmFtZQUIa2V5d29yZHMeB2NvbnRlbnQFJnRlc3Qga2V5d29yZHMsd2VsY29tZSB0byB0ZXN0IGtleXdvcmRzZAICDxYEHwAFC0Rlc2NyaXB0aW9uHwEFIVRoaXMgaXMgdGhlIHRlc3QgcGFnZSBkZXNjcmlwdGlvbmRkrw2tXR7g0Lii+IR8lS9SlJoCF/Y=" />
</div>
<div>

</div>
</form>
</body>
</html>



Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

A First Look at Visual Studio 2010


Tuesday, November 3, 2009


After a long wait, Microsoft has released Visual Studio 2010 this month. Microsoft also sets the stage for the RTM("release to manufacturing" or "release to marketing") release on March 22, 2010.
I and my friend downloaded one copy of VS2010 and we have installed it on windows 7.


VS 2010 SplashScreen



VS 2010 Start PageThis page shows you start page of VS2010.


New Project TeamplateIn this image you can find, multiple target frameworks and ASP.NET MVC 2 project template.


Dynamic Typesee dynamic type in C#


Generate ClassVS2010 offers a new feature to generate class
from calling code.



There are lot more features in VS2010 and .Net Framework 4 to play with, this is just a trailer, Full movie will be shown soon on this blogspot, so keep reading this blog for updates. I really fun
with the powerful features that they provide.


You can download your copy form here:
Visual Studio 2010


Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

Get cloud tag for your website or blogspot


Monday, November 2, 2009



To get this above flash tags cloud for you website or blogger just follow this below steps



Go to Layout>Edit HTML in your Blogger dashboard,
and search for the following line (or similar):

<b:section class='sidebar' id='sidebar' preferred='yes'>


Immediatly after this line, paste the following section of code:

<b:widget id='Label99' locked='false' title='Labels' type='Label'>
<b:includable id='main'>
<b:if cond='data:title'>
<h2><data:title/></h2>
</b:if>
<div class='widget-content'>
<script src='http://halotemplates.s3.amazonaws.com/wp-cumulus-example/swfobject.js' type='text/javascript'/>
<div id='flashcontent'>Blogumulus by <a href='http://www.roytanck.com/'>Roy Tanck</a> and <a href='http://www.rajeshssingh.blogspot.com'>Amanda Fazani</a></div>
<script type='text/javascript'>
var so = new SWFObject(&quot;http://halotemplates.s3.amazonaws.com/wp-cumulus-example/tagcloud.swf&quot;, &quot;tagcloud&quot;, &quot;240&quot;, &quot;300&quot;, &quot;7&quot;, &quot;#ffffff&quot;);
// uncomment next line to enable transparency
//so.addParam(&quot;wmode&quot;, &quot;transparent&quot;);
so.addVariable(&quot;tcolor&quot;, &quot;0x333333&quot;);
so.addVariable(&quot;mode&quot;, &quot;tags&quot;);
so.addVariable(&quot;distr&quot;, &quot;true&quot;);
so.addVariable(&quot;tspeed&quot;, &quot;100&quot;);
so.addVariable(&quot;tagcloud&quot;, &quot;<tags><b:loop values='data:labels' var='label'><a expr:href='data:label.url' style='12'><data:label.name/></a></b:loop></tags>&quot;);
so.addParam(&quot;allowScriptAccess&quot;, &quot;always&quot;);
so.write(&quot;flashcontent&quot;);
</script>
<b:include name='quickedit'/>
</div>
</b:includable>
</b:widget>


Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com