Posts

Showing posts from June, 2014

HTTP Response Status Codes

The following table contains the constants and corresponding values for the HTTP status codes returned by servers on the Internet. HTTP_STATUS_CONTINUE 100 The request can be continued. HTTP_STATUS_SWITCH_PROTOCOLS 101 The server has switched protocols in an upgrade header. HTTP_STATUS_OK 200 The request completed successfully. HTTP_STATUS_CREATED 201 The request has been fulfilled and resulted in the creation of a new resource. HTTP_STATUS_ACCEPTED 202 The request has been accepted for processing, but the processing has not been completed.

Validatation control in Phone Number Using Jquery

Html Phone Number: <input type='text' id='txtPhone'/> <span id="spnPnestats"></span> CSS: body {     padding: 10px;     font-family: Arial;     Font-size: 10pt; } span {     font-weight:bold; } JQuery: $(document).ready( function () {     $(' #txtPhone ').blur( function (e) {         if (validatePhone(' txtPhone ')) {             $(' #spnPnestats ').html(' Valid ');             $(' #spnPnestats ').css( 'color', 'green' );         }         else {             $(' #spnPnestats ').html(' Invalid ');             $(' #spnPnestats ').css( 'color', 'red' );         }     }); }); function validatePhone( txtPhone ) {     var a = document.getElementById( txtPhone ).value;     var filter = /^[0-9-+]+$/ ;     if ( filter .test( a )) {         return true ;     }     else {    

Solution for SQL Server 2008 Intellisense Problem

Image
 If Using SQL Server 2008 R2 or any version some users as Intellisense Feature Does not  Working Problem Arrived. But As solve Problem.             Using dbForge Tool To solve  the problems.                    To Download Click Here dbForge SQL Complete, v4.7 StandarddbForge SQL Complete, v4.7 Standard dbForge SQL Complete, v4.7 Standard dbForge SQL Complete, v4.7 Standard

Different Time Format In SQL Server

1.Get HH:mm:ss Time Format:       select convert ( varchar (10), GETDATE () ,108) as Time             Result:            Time           22:45:44 2.Get HH:mm:ss:mmm Time Format:       select   convert ( varchar (20), GETDATE () ,114)  as  Time             Result:            Time           22:45:44:887

Different Format in getdate() in SQL Server

            In this  SQL Server using  GETDATE () to find different type of the Date format will be get the date. 1.Get MMM dd yyy Date Format:       select convert ( varchar (10), GETDATE () ,100) as Today            Result:            Jun 27 201 2.Get MM/dd/yyyy Date Format:       select   convert ( varchar (10), GETDATE () ,101)  as  Today            Result:            06/27/2014 3.Get yyyy.MM.dd Date Format:       select   convert ( varchar (10), GETDATE () ,102)  as  Today            Result:            2014.06.27 4.Get dd/MM/yyyy Date Format:       select   convert ( varchar (10), GETDATE () ,103)  as  Today            Result:            27/06/2014

operation is not valid due to the current state of the object-ASP. Net Error

Image
Is the one of the  error in ASP .net Using Forms and fields it will happen in the  processing any events.      To Use Maximum Number Of Fields or Big Data using the Forms get this Error.           To Resolve this Error Using Web.Config file.            <appSettings>                <add key = "aspnet:MaxHttpCollectionKeys" value = "4000" /> </appSettings> Note: Default  aspnet:MaxHttpCollectionKeys value is 1000

Find Number Of Tables in Database

To use Count() function as Returns the Number of Rows or values of the Specified Column:        SELECT COUNT (column_name) FROM table_name; In this above code find Number Of Rows in Specified Columns. And we can find Number of Tables in the Database In SQL Server 2008 or 2012.         USE DB_news  -- DB_news as Database Name         SELECT COUNT (*) from information_schema.tables         WHERE table_type = 'base table'       It will Be Shown the Number of Tables in the Selected Database.

Convert Date Format MM/dd/yyyy To dd-MM-yyyy In Asp.net

            string dat = txtdate.Text;             string strdat = DateTime .ParseExact(dat," dd-MM-yyyy ", null ).ToString(" MM/dd/yyyy ");             DateTime dt1 = Convert .ToDateTime(strdat);

Store Null Integer Values Without Conversion Error

Image
   This one of the problem for using Asp.net Developers. Textbox can Store without any values to Press Button Event . To Display the Conversion Error.For Like This...... In this  state we can use Code as                                                                     int val2 = Convert .ToInt32(t2.Text); To Use Another method to Empty Textbox  You can pressed to store Null value  to the Database  Without Any Conversion Error.                 string str = string .IsNullOrEmpty(t1.Text) ? "0" : t1.Text;                                                          int val = Convert .ToInt32(str); In this Method can Use Store or any Functionality.

Session Timeout In Asp.Net

    Session can use store just similar data for user Like Cookies.Sessions can be used easily in ASP.NET with the Session object.     ASP.NET supports various Session State Modes depending on various storage options for session data. The following are the available Session State Modes in ASP.NET: InProc StateServer SQLServer Custom Off The InProc Session State Mode is the default session mode but you can also set the Session State Mode and session timeout in the Web.Config file of you application as in the following code snippet.  < configuration >   < system.web >         < sessionState   mode = " InProc "   timeout = " 40 " ></ sessionState >   </ system.web > </ configuration > The preceding session timeout setting keeps the session alive for 40 minutes. If you don't define a timeout attribute in the SessionState then the default value is 20 minutes.       Default Session Timeout Time  -------&g

Allow Only Numeric Values in Asp.Net Textbox Using JavaScript

< html > < head > < script language ="Javascript"> function isNumOnly ( evt ) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; } </ script > </ head > < body > < asp:TextBox ID ="txtno" Text ="" onkeydown =" return isNumOnly ( event ) " runat ="server"></ asp:TextBox > </ body > </ html >

Disable back button using javascript

For disabling the back button functionality in the browser Use this code on the master page  <script type="text/javascript"> function noBack() { window.history.forward() } noBack(); window.onload = noBack; window.onpageshow = function (evt) { if (evt.persisted) noBack() } window.onunload = function () { void (0) } </script> In this code using the <head> --script--</head>