Friday, February 28, 2014

SQL QUERY TO FIND NOT CONTAINS VALUES

SQL QUERY - NOT CONTAINS VALUES FROM TWO TABLES  AND SAME COLUMNS

DESCRIPTION:

             In my example I have used Toad SQL Server 2008 as a query analyser.

Objective:
            To obtain the not contains value of a two tables with same column name., if table A has a column city and table B has a column city, in this scenario we need to get the cities of table A which not contains in table B.

Table "A" contains


Table "B" contains



Now I need to get the cities from table "A" which not contains in table "B"

The query is,


and we get the result as shown in below,


Thank you!

Wednesday, February 26, 2014

autocomplete textbox using jquery

AUTOCOMPLETE TEXTBOX USING JQUERY

DESCRIPTION:

         THE TEXT BOX WITH AUTO SUGGESTION OR AUTO COMPLETE TEXT BOX CAN BE DONE WITH THE USE OF JQUERY 1.9.1 JS AND JQUERY UI 1.10.4.

STEP 1: CREATE A TEXT BOX WITH SOME NAME ANY ID.

STEP 2: NOW ON THE HEADER SECTION ADD THE FOLLOWING CODE


STEP 3:  AFTER ADDING THE STYLE AND SCRIPT ON THE HEADER SECTION ADD THE FOLLOWING SCRIPT IN BODY OR HEAD OF THE HTML, WITH THE NO. OF INPUTS FOR THE AUTO SUGGESTION TEXTBOX.



STEP 4:

ADD THE UI CLASS AS SHOWN BELO IN THE TEXTBOX TAG


NOW YOU HAVE DONE NOW TYPE AND SEE THE INPUT, FOLLOWING SHOWS THE RESULT OF MY EXAMPLE.





Monday, February 24, 2014

JQuery delay function

 JQuery time delay function

Description:

             Here we going to learn how to work on delay function using setTimeout function in jquery.

Execute time delay function refers the jquery plugin 1.8.2.js

Example:

Use the jquery plugin 1.8.2.js and add the source file to the script.
after that add the below script function to your program.



  here I have added label on my webpage which has a id lblTime.
here the setTimeout will execute the function after one minute
1000 = 1 Second.

******************************************************
     

Sunday, February 23, 2014

File Upload using JQuery plugin

FILE UPLOAD USING JQUERY PLUGIN

DESCRIPTION:
    
    Hi, in this blog we going to learn how to upload multiple files using jquery plugin. In this example I am using VS2008, and Jquery plugin 

You can download the plugin from uploadify plugin .

First need to add the css file and the js file we get from the above link, and check the aspx page where I declare in my aspx page and Create a folder in the solution explorer name it as UploadFiles.


 In the above example I have used ashx handler page this can be added by right click on your solution and from choose add item and select generic handler.

Now open the ashx page and add the code as below,


Thats all you have done!

Thursday, February 20, 2014

PASS OR SEND THE VALUE FROM HTML PAGE TO WEB SERVICE PAGE

Pass the value from html page to webservice page using javascript

Introduction
   
     Hi, today we going to learn how to pass the values from html page to web service page. This will be an important one to be learn for working on the web services related tasks or wit the api services.

Description

     A simple example will be provided here for the better understanding, to transfer the data of html controls follow the below steps.

Step 1:  Add the soapclient.js file in your project.

Step 2: Add the controls and values in web page, in my example I am adding one text area and one button, so that if I click the button the text area value to go to the web service and get the result back.






Step 3: No on the script page add the variables as shown in the below pic.










here, the go2service will work on the click event of button, the txtareavalue will have the textarea field Text values and the parameters will contains the parameters to be passed to  the webservice method.

servicefunction_callback will return the value received from the web service method.

And I am returning the value to the same text area field.

Step: 3 Add the function and parameter value must be same given in the script.



Here I have added simple method which will return the string value.


here is the example run video in gif format.



THANK YOU!

Monday, February 17, 2014

SHOW HIDE PASSWORD USING JQUERY

Using JQuery show hide password with a button

Introduction:

   The password text field sometime required a show hide password option that time we can make use of jquery plugins.

In my example I am using jquery 1.10.2 plugin.

Description:

   In my example I am using visual studio 2010, to begin the task first we need to create a html or aspx page with the necessary controls, ie., password text box and a button.

as shown below




here I am using two input type password and a textbox..
using hide and show we going to display the contents.

After designing we have to use the script as like BELOW,

Now, run the application and type the password and click the button it will show and hide according to the display of textbox.
******************************************************

Saturday, February 15, 2014

ASP PAGE LIFE CYCLE

ASP PAGE LIFE CYCLE

Introduction:

     The life cycle of an asp.net page can be understandable easily if you have a knowledge of some keywords like viewstatepostback and events in asp.net 

Description:

PreInit -

In preinit you can check weather the page is loaded first time             or  not using IsPostBack property.
* On the first time load page you can create control with values.
* You can set master page and theme dynamically.

* If the page is postback, you can set control property value to           be overwritten. 
 * The values have not been yet restored from viewstate.
     
Init -

* In the Init event of the individual controls occurs first, later               the Init event of the Page takes place.
 * This event is used to initialize control properties.

InitComplete -

* In the InitComplete event the viewstate property checking will be done and that changes will be persisted until next postback.

PreLoad -
* This will process the data on postback event with the request.

Load -
* In this process the initial Page controls or objects calls the OnLoad method and that method with any controls or objects comes next.

ControlEvents -

* This events occurs after page loads like onclick in button, textchanged in textbox, onchange in dropdownlist etc.

In case of the postback, 
if the page contains validator controls , the page.isvalid property and the validation of the control takes place before the firing of individual events.

Load Complete - 

* This session occurs after the event handling page.
* This will complete all controls and their methos events.

Pre Render -

This method is used to make final changes to the controls on the page like assigning the DataSourceId and calling the DataBind method.

PreRenderComplete -

* This event is raised after all the final id values are set in prerender completes.

SaveStateComplete -

* This will occur after control state and view state saved.

RenderComplete -

* This method writes the controls values or markup to the browser.

Unload -

* This event is raised for each control and then for the page.

* This will do the final clean up work and close dataconnection etc.,

If any clarification or need changes please comment.
Thank you!

     

SQL SELECT names between 2 characters in sql server table

Get names between 2 characters in sql server table

Introduction:

Just find out the names between two characters starting with characters a to d in a sql server datatable column.

Description:

      I have a name column as like below, 

Now I am going to select the names from the column whos names were starting from letter a to d.

Use 

Select * from names where name like '[a-d]%'

and this returns me the following result.



******************************************************

JQuery special character Identifier

Using JQuery _ find special character in a string or text box

Introduction:

                    Using JQuery we can find weather a string variable or a textbox contains any special characters or not.

Description:

Using the below example you can be easily apply the method to check weather  a string contains special characters or not, it will be useful for the name textbox.

Example:


Time difference in SQL SERVER

Find Time Difference of two  Dates using SQL SERVER


Introduction:

Here we going to learn how to obtain the difference of time in terms of sql query in sql server.

Description:

The time difference of two time can be a easy task in terms of sql server, today we going to learn how it can be achieved using simple sql  query.

In my example I am using Toad for SQL Server as a query analyser tool.

Thanks if you have any other doubts are questions please ask and share the knowledge!
Thank you for visiting my blog!

Friday, February 14, 2014

Overloading and Overriding in C#

Overriding and Overloading in C#

Hi, today we going to learn all about the overloading and overriding concepts in c# with example.

Description:

Before going to the overloading and overriding, we have to learn polymorphism, which is the one of the important concept of oops.

Poly means 'many' , morph means 'forms' hence, hence the polymorphism means ability to take many forms.

In polymorphism we can declare the same method name with different arguments in a class and same method name with same arguments in different classes. The polymorphism has the ability to provide different method implementation and that are with the same name.

We have two types of polymorphism, namely

Overloading and Overriding 

Overloading:

In overloading the same name with different signature can be used, thus provides us the benefit of using same name with different tasks. This is also called as compile time polymorphism .

Overriding:

In overriding the method name have same signature can be used in many class with the reference, hence at the runtime only the method and its signatures will be known to the clr.
This is also known as runtime polymorphism.

Overriding an be performed using virtual and override keywords.

Initially we need to create a method with the name virtual and when using the same method name we have to use override keyword.

*signature = parameters

example of overloading:


Example of overriding:



for more information refer my other posts too!
Thank you!