Thursday 1 August 2013

How to parse json in classic asp

aspjson.asp  download from this link

[INPUT]

{
“firstName”: “John”,
“lastName” : “Smith”,
“age” : 25,
“address” :
{
“streetAddress”: “21 2nd Street”,
“city” : “New York”,
“state” : “NY”,
“postalCode” : “10021″
},
“phoneNumber”:
[
{
"type" : "home",
"number": "212 555-1234"
},
{
"type" : "fax",
"number": "646 555-4567"
}
]
}

<!–#include virtual=”/aspJSON.asp” –>

<%
Set oJSON = New aspJSON

‘Load JSON string
oJSON.loadJSON(jsonstring)

‘Get single value
Response.Write oJSON.data(“firstName”) & “<br>”

‘Loop through collection
For Each subItem In oJSON.data(“address”)
Response.Write subItem & “: ” & _
oJSON.data(“address”).item(subItem) & “<br>”
Next

‘Update/Add value
oJSON.data(“firstName”) = “James”

‘Return the object
Response.Write oJSON.JSONoutput()
%>

Friday 19 July 2013

How do I put Google Adsense ads on website

Please use this code and change google_ad_client value

<script type="text/javascript">
google_ad_client = "AIzaSyDFsldP-wTV6jdR4D-MxQojl831HGXAhVI";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_color_border = "FFFFFF";
google_color_bg = "0000FF";
google_color_link = "FFFFFF";
google_color_text = "000000";
google_color_url = "008000";
</script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

How to Remove Restricted User in SQL Server

execute this query
Use [dbname]
ALTER DATABASE [dbname] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
ALTER DATABASE [dbname] SET MULTI_USER
GO