Tuesday, December 30, 2008

How To Turn On Visual Studio 2005 Line Numbering

Step 1:


Select Tools from the menu.


Step 2:

Select Options in Tools Menu,When The Options Dialog is open Select and Expand Text Editor From Tree View.





Step 3:

Select C# Node, you can see Display on the Righthand side, below that there is An Line Number Checkbox which unchecked by Default.



Step 4:

Select that Line Number Checkbox once it checked Click Ok Button.




Step 5:

After that when you see your codebehind part there will line number displaying on your window.




How To Create Menu Dynamically With Child Elements

protected void Page_Load(object sender,  EventArgs e)
{

Menu
myMenu = new Menu();
this.form1.Controls.Add(myMenu);
MenuItem mnItem = new MenuItem("Dyamnic Menu");
myMenu.Items.Add(mnItem);


MenuItem menuNodeChild = new MenuItem("Xploredotnet");
mnItem.ChildItems.Add(menuNodeChild);
menuNodeChild.NavigateUrl =
"http://www.Xploredotnet.com";
menuNodeChild = new
MenuItem("ASP.NET");
mnItem.ChildItems.Add(menuNodeChild);
menuNodeChild.NavigateUrl =
"http://www.asp.net";


myMenu.Orientation =
Orientation.Horizontal;
//myMenu .Orientation = Orientation.Vertical;
}


How To Add Menu Dynamically

protected void Page_Load(object sender,  EventArgs e)
{

Menu
myMenu = new Menu();
this.form1.Controls.Add(myMenu);
MenuItem mnItem = new MenuItem("test");
myMenu.Items.Add(mnItem);
myMenu.Orientation =
Orientation.Horizontal;
//myMenu .Orientation = Orientation.Vertical;
}


How To Get The List Of Database Available In Particular Server

SELECT * FROM master.dbo.sysdatabases



Thursday, December 25, 2008

How To Delete A Duplicate Records From Table

Query To Find The Duplicate Records

SELECT ColumnName1,ColumnName2,ColumnNameN,count(*) As UserDefinedColName
FROM TableName
GROUP BY ColumnName1,ColumnName2,ColumnNameN
HAVING count(*) > 0

Query To Delete Duplicate Records

select distinct * into #tmpTableName from TableName
truncate table TableName
insert TableName select * from #tmpTableName
drop table #tmpTableName



Saturday, December 20, 2008

What's the difference between ISNULL & COALESCE

ISNULL()

It replace the NULL with the specified replacement value. The value of check_expression is returned if it is not NULL; otherwise, replacement_value is returned after it is implicitly converted to the type of check_expression, if the type is different.

Syntax

ISNULL ( check_expression , replacement_value )

check_expression

The expression to be checked for NULL. check_expression can be of any type.

replacement_value

Is the expression to be returned if check_expression is NULL. replacement_value must be of a type that is implicitly convertible to the type of check_expresssion.

COALESCE()

Returns the first nonnull expression among its arguments.

Syntax

COALESCE ( expression [ ,...n ] )

expression

It'can be of any type.

Note:
ISNULL()
and COALESCE() though both are equivalent, but they behave differently. An expression involving ISNULL with non-null parameters is considered to be NOT NULL, while expressions involving COALESCE with non-null parameters is considered to be NULL.

For More Inforamtion :

ISNULL() or COALESCE()?

Performance: ISNULL vs. COALESCE

ISNULL() <> COALESCE(). Discuss

What Is th difference between Is Null & COALESCE

ISNULL (Transact-SQL)

COALESCE (Transact-SQL)



Friday, December 19, 2008

whats the difference between sp_helptext and sp_help

sp_helptext
sp_helptext displays the definition of a user-defined rule, default, unencrypted Transact-SQL stored procedure, user-defined Transact-SQL function, trigger, computed column, CHECK constraint, view.

Syntax:-
sp_helptext [ @objname = ] 'name' [ , [ @columnname = ] computed_column_name ]

Example:
Exec sp_helptext proc_name.

sp_help
sp_help reports information about a database object (any object listed in the sysobjects
table), a user-defined data type

Syntax:-
sp_help [ [ @objname = ] name ]

Example:
EXEC sp_help tablename



Thursday, December 18, 2008

How to check whether temp table exist

if object_id('tempdb..##temptblname') is not null
drop table ##temptblname



Failed to access IIS metabase

Cause:-
When you install IIS AFTER .NET 2.0 framework, the rights of the ASPNET user had not been set correctly.

In Command Prompt Go to this following Location

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 then type aspnet_regiss -i




Wednesday, December 17, 2008

How To Make "Incognito mode" as default mode InChrome

Step I:
Right Click on the shortcut of Google Chrome & select ‘Properties’

Step II:
Then in the ‘Target’ field add “-incognito” in the end, it is without the quotes.

Example Path :
"C:\Documents and Settings\User\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --incognito




Finally Click on OK


Format JSON String To JSON Structure

To Format JSON String to JSON Format .... go there




Creative Commons License
Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.