Skip to main content

Posts

Showing posts from December, 2013

Iterate through nested JSON Data using javascript

Below is the code used: <! DOCTYPE html > < html > < head >     < script src ="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></ script >     < meta charset ="utf-8" />     < title > JS Bin </ title > </ head > < body >     < div id ="output">     </ div >     < script >         ( function () {             var myobj = {                 obj1: { key1: 'val1' , key2: 'val2' },                 obj2: { key1: '2val1' ,                     key2: { nest1: 'val1' , nest2: 'val2' , nest3: 'val3' },                     key3: { nest1: 'K3val1' , nest2: 'K3val2' ,                         nest3: [                         { nest1: 'val1' , nest2: 'val2' , nest3: 'val3' },                         { nest1: 'val1' , nest2: 'val2&

Iterate through json array using javascript

Javascript Array: var myArray = { "artists" :[{             "a1" : "Adam Sandler" ,             "a2" : "Adam Lambert" ,             "a3" : "Avril Levine" ,             "a4" : "Backstreet Boys" ,             "a5" : "Blackstreet" ,             "a6" : "Black Eye Peas" ,             "a7" : "Cool and the Gang" ,              "a8" : "Chicago" ,             "a9" : "Charlie Manson"         }],         "songs" :[{             "s1" : "Grow Old With You" ,             "s2" : "Whatdaya Want From Me" ,             "s3" : "Yea yea" ,             "s4" : "Quit Playing Games With My Heart" ,              "s5" : "No Digity" ,             "s6" : "Meet Me

How to create table in sql server 2008

In this article i am going to explain about how to create table in sql server 2008. "Create Table" Statement is uesd to create table in sql server. In sql server tables are organised as rows and columns.And each column will have name and the datatype it accepts. So creating table in sql server we need to create columns with datatype. Below is the syntax to create table in sql server 2008. CREATE TABLE table_name ( column_name1 data_type ( size ), column_name2 data_type ( size ), column_name3 data_type ( size ), .... ); Below is the script to create student table CREATE TABLE StudentMaster ( Name VARCHAR ( 50 ), Standard INT , Section CHAR ( 5 ) ) After creating table you can check it in the object explorer. After creating table we can insert the record in the table in the below format INSERT INTO StudentMaster ( Name , Standard , Section ) VALUES ( 'Kannadasan' , '12' , 'A' )