Posts

Showing posts from July, 2012

"< noscript >...< /noscript >" in JAVASCRIPT

It also known as  "Javascript Fallback Content "  People can turn Javascript off in their browser software which can cause your document to appear broken or incomplete to them if you are using Javascript to render content in any way. There are also situations in which automated software is attempting to index your document's content and it may not be able to process Javascript. HTML sports a Javascript content fallback feature in which anyone without Javascript enabled will be served up your alternate content, while regular users see the Javascript enabled content. This is done using the <noscript> element of HTML. If the user has Javascript enabled the <script> element will process while the <noscript> element is completely ignored. If the user does not have Javascript enabled the <script> element gets ignored, and the <noscript> element will process. Example : < head runat ="server"> < title ></ title

Cross Page Postback

Crosspage.aspx : <%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <script runat="server"> </script> <html xmlns=" http://www.w3.org/1999/xhtml "> <head runat="server">     <title>asp.net cross page postback example</title> </head> <body>     <form id="form1" runat="server">     <div>         <h2 style="color:Red">asp.net Cross-Page PostBack example</h2>         <asp:Label             ID="Label1"             runat="server"             Text="ProductID"             ForeColor="DodgerBlue"             >         </asp:Label>         <asp:TextBox             ID="TextBox1"             runat="server"             ForeColor="AliceBlue"

nav element in HTML5

Like <header> , <nav> is a section element with a clear purpose. I have it on the left on this site though it's often placed horizontally above or below the header. Technically you can place it (or them – there can be more than one) anywhere you want, but remember never make it difficult for visitors. One of the most common mistakes beginners – and for that matter, many professionals – make is to not make navigation simple, straight forward and intuitive . The <nav> element is for "major navigation blocks" * . It can go in the header or article tags (which we will look at next); or it can be on its own. On the left I have it on its own and in the article element the "previous" and "next" links are in nav tags. Example  : <!DOCTYPE html> <html> <body> <nav> <a href="/html/">HTML</a> | <a href="/html5/">HTML5</a> | <a href="/css/">CSS<

HOW TO USE THEAD , TBODY , TFOOT IN HTML

Image
DESCCRIPTION : The <tbody> tag is used to group the body content in an HTML table. The <tbody> element is used in conjunction with the < thead > and < tfoot > elements to specify each part of a table (body, header, footer). Browsers can use these elements to enable scrolling of the table body independently of the header and footer. Also, when printing a large table that spans multiple pages, these elements can enable the table header and footer to be printed at the top and bottom of each page. The <tbody> tag must be used in the following context: As a child of a <table> element, after any <caption>, <colgroup>, and <thead> elements. EXAMPLE : <table border="1">   <thead>     <tr>       <th>NIHAR </th>       <th>BLOG</th>     </tr>   </thead>   <tfoot>     <tr>       <td>Sum</td>       <td>RS.180</td>   

Difference between == and === in JAVASCRIPT / PHP

=== and !== are strict comparison operators: JavaScript has both strict and type-converting equality comparison. For strict equality the objects being compared must have the same type and: Two strings are strictly equal when they have the same sequence of characters, same length, and same characters in corresponding positions. Two numbers are strictly equal when they are numerically equal (have the same number value). NaN is not equal to anything, including NaN. Positive and negative zeros are equal to one another. Two Boolean operands are strictly equal if both are true or both are false. Two objects are strictly equal if they refer to the same Object. Null and Undefined types are == (but not ===). Example :                0 == false   // true                  1 === "1"     // false, because they are of a different type                  1 == "1"     // true, auto type coercion                  0 === false   // false, because they are of a dif
It also known as  "Javascript Fallback Content "  People can turn Javascript off in their browser software which can cause your document to appear broken or incomplete to them if you are using Javascript to render content in any way. There are also situations in which automated software is attempting to index your document's content and it may not be able to process Javascript. HTML sports a Javascript content fallback feature in which anyone without Javascript enabled will be served up your alternate content, while regular users see the Javascript enabled content. This is done using the <noscript> element of HTML. If the user has Javascript enabled the <script> element will process while the <noscript> element is completely ignored. If the user does not have Javascript enabled the <script> element gets ignored, and the <noscript> element will process. Example : < head runat ="server"> < title ></ title &

ORA-01843: not a valid month

ORA-01843 not a valid month   Cause: A date specified an invalid month. Valid months are: January-December, for format code MONTH, and Jan-Dec, for format code MON.   Action: Enter a valid month value in the correct format Example :  How :->    * FROM emp SELECT   WHERE Error : ORA-01843: not a valid month Solution : SELECT * FROM emp   WHERE Try it !!   BIRTH_DT >= '31/DEC/1988' AND BIRTH_DT <= '31/DEC/2012' BIRTH_DT >= '31/12/1988' AND BIRTH_DT <= '31/12/2012'

RESERVED KEYWORDS IN SQL / PL-SQL

PL/SQL Reserved Words have special meaning in PL/SQL, and may not be used for identifier names (unless enclosed in "quotes"). An asterisk (*) indicates words are also SQL Reserved Words. ALL*            DESC*           JAVA            PACKAGE         SUBTYPE ALTER*          DISTINCT*       LEVEL*          PARTITION       SUCCESSFUL* AND*            DO              LIKE*           PCTFREE*        SUM ANY*            DROP*           LIMITED         PLS_INTEGER     SYNONYM* ARRAY           ELSE*           LOCK*           POSITIVE        SYSDATE* AS*             ELSIF           LONG*           POSITIVEN       TABLE* ASC*            END             LOOP            PRAGMA          THEN* AT              EXCEPTION       MAX             PRIOR*          TIME AUTHID          EXCLUSIVE*      MIN             PRIVATE         TIMESTAMP AVG             EXECUTE         MINUS*          PROCEDURE       TIMEZONE_ABBR BEGIN           EXISTS*         MINUTE          PUBLIC*        

Datepart in SQL Server And Oracle

SQL Server DATEPART() Function Syntax : DATEPART(datepart,date) datepart Abbreviation year yy, yyyy quarter qq, q month mm, m dayofyear dy, y day dd, d week wk, ww weekday dw, w hour hh minute mi, n second ss, s millisecond ms microsecond mcs nanosecond ns Examples : select Result : 2012 datepart ( yyyy , birth_date ) from [Table_name] Oracle : Alternative for DATEPART() Function SELECT   SELECT TO_NUMBER ( TO_CHAR (SYSDATE, 'HH24' )) FROM DUAL SELECT current_timestamp ,SYSDATE FROM dual extract ( hour FROM current_timestamp ) FROM dual

How the ALL keyword works in oracle

Multiset operators combine the results of two nested tables into a single nested table. The examples related to multiset operators require that two nested tables be created and loaded with data as follows: First, make a copy of the oe.customers table called customers_demo . We will add the nested table columns to customers_demo . CREATE TABLE customers_demo AS SELECT * FROM customers; Simple Example : Condition               Equivalent expression x > ALL  ( 1 ,  2 )           x >  2 x < ALL  ( 1 ,  2 )           x <  1 x = ALL  ( 1 ,  2 )          ( x =  1 )  AND  ( x =  2 ) x <> ALL  ( 1 ,  2 )         ( x <>  1 )  AND  ( x <>  2 ) SELECT  * FROM [table_name]   WHERE  abc_cd < ALL ( 0097 , 0098 ) Output : It shows all abc_cd below 97,98 OR SELECT  BankerName, BillingNumber, BillingTotal   FROM  Billings JOIN Bankers ON Billings.BankerID = Bankers.BankerID WHERE  BillingTotal > ALL (SELECT  BillingTotal FROM  Billings WHERE  Banke

How to set Page Hits in asp.net [Simple Method]

.Try it.... Happy Coding :):):) C# : protected void Page_Load( object sender, EventArgs e) { this .countMe(); DataSet ds = new DataSet (); ds.ReadXml(Server.MapPath( "~/counter.xml" )); lblMsg.Text = ds.Tables[0].Rows[0][ "hits" ].ToString(); } private void countMe() { DataSet ds = new DataSet (); ds.ReadXml(Server.MapPath( "~/counter.xml" )); int hits = Int32 .Parse(ds.Tables[0].Rows[0][ "hits" ].ToString()); hits += 1; ds.Tables[0].Rows[0][ "hits" ] = hits.ToString(); ds.WriteXml(Server.MapPath( "~/counter.xml" )); } ASPX : ... < div > < asp : Label ID ="lblMsg" runat ="server"></ asp : Label > </ div > ... Counter.xml <counter > < count > < hits > 1 </ hits > < count > < counter >

Importing MS Excel data to SQL Server 2008

Image
The Import and Export Wizard The import and export wizard was available even with SQL 2000 has remained an important tool for exporting from and importing into SQL Server data from many different kinds of data sources. It can also be used for transferring data between non-Microsoft data sources. In this article, an example of transferring an MS Excel spreadsheet data to SQL Server 2008 is described. In any of the transformations it is important to realize that data types used in data sources are not exactly the same and that there are differences to be reckoned with. The basic steps to take are to indicate the source of data and the destination to which it needs to be transferred. In order to match the differences some mappings may be necessary if the source and destination are not both SQL Servers. The MS Excel file PrincetonTemp.xls used in this example is a simple spread sheet data that shows the temperature variations during a year and the maximum recorded temperature. The data

How to insert data from one table to another table in SQL/Oracle

Method 1 : INSERT INTO SELECT This method is used when table is already created in the database earlier and data is to be inserted into this table from another table. If columns listed in insert clause and select clause are same, they are are not required to list them. I always list them for readability and scalability purpose. USE AdventureWorks GO ----Create TestTable CREATE TABLE TestTable ( FirstName VARCHAR ( 100 ), LastName VARCHAR ( 100 )) ----INSERT INTO TestTable using SELECT INSERT INTO TestTable ( FirstName , LastName ) SELECT FirstName , LastName FROM Person.Contact WHERE EmailPromotion = 2 ----Verify that Data in TestTable SELECT FirstName , LastName FROM TestTable ----Clean Up Database DROP TABLE TestTable GO Method 2 : SELECT INTO This method is used when table is not created earlier and needs to be created when data from one table is to be inserted into newly created table from another table. New table is created with same data types as selected columns. USE AdventureW

Synonyms in Oracle

A synonym is an alias for one of the following objects : table object table view object view sequence stored procedure stored function package materialized view java class used defined object object type another synonym The object does not need to exist at the time of its creation. How to create synonyms ? CREATE SYNONYM   table_name    FOR table_name   How to display list of all synonyms from database ? SELECT   ORDER BY 1 , 2 'SYNONYM:' , synonym_name , table_owner FROM USER_SYNONYMS or SELECT * FROM ALL_SYNONYMS

how to use ViewState in asp.net

asp.net ViewState example: how to use ViewState in asp.net  aspx :   <body>     <form id="form1" runat="server">     <div>         </div>     <asp:Label ID="lblCount" runat="server" Text=""></asp:Label>     <br />     <br />     <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />     </form> </body>     c# :  protected void Button1_Click(object sender, EventArgs e)         {             int count = 1;             if (ViewState["count"] == null)             {                 count = 1;             }             else             {                 count = (int)ViewState["count"] + 1;             }             ViewState["count"] = count;             lblCount.Text = "Count = " + count;         }  

HOW TO DISPLY MESSEGE WHEN CAPS LOCK IS ON IN LOGIN PAGE

IN ASPX PAGE JAVA SCRIPT :     < script language =" javascript" type =" text/javascript" > function capLock(e){ kc = e.keyCode?e.keyCode:e.which; sk = e.shiftKey?e.shiftKey:((kc == 16 )? true : false ); if (((kc >= 65 && kc <= 90 ) && !sk)||((kc >= 97 && kc <= 122 ) && sk)) document.getElementById( ' divMayus' ).style.visibility = ' visible' ; else document.getElementById( ' divMayus' ).style.visibility = ' hidden' ;   }   </ script >   //THIS IS THE DIV THAT WILL DISPLAYED ON CAPS LOCK ON.. < div id =" divMayus" style =" visibility:hidden" > < asp:Label ID =" Label1" runat =" server" Text =" Caps Lock is On.!" > < / asp:Label > < / div >   //THIS IS THE TEXT BOX AT WHICH U WANT TO CALL JAVASCTIPT.. < asp:TextBox ID =" txtPassword" runat =" s

UpdatePanel in ASP.NET

ASPX : <body>     <form id="form1" runat="server">       <div style="padding-top: 10px">         <asp:ScriptManager ID="ScriptManager1" runat="server">         </asp:ScriptManager>         <asp:UpdatePanel ID="UpdatePanel1" runat="server">             <ContentTemplate>                 <fieldset>                 <legend>UpdatePanel</legend>                 <asp:Label ID="Label1" runat="server" Text="Panel created."></asp:Label><br />                 <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />                 </fieldset>             </ContentTemplate>         </asp:UpdatePanel>         <br />         </div>     </div>     </form> </body> If you are using MASTER PAGE IN PROJECT