Search This Blog

Thursday, September 27, 2012

How can create new column by query that column not in table:


How can create new column by query that column not in table:
We have one table test in this table 2 columns
Sno, name I want 3rd columns for ues then we have create 3rd column by query and also fixed that column value “0”.

select sno,name,'0' as amount from test

Out put:
sno
name
amount
1        
cp       
0
2        
ram      
0
3        
jon      
0

Understand diffrence between 1st and 2nd query:

select sno,name,sno as amount from test

Output:
sno
name
amount
1        
cp       
1        
2        
ram      
2        
3        
jon      
3        

Friday, September 14, 2012

What is the difference from Hosted Adsense content and adsense content?

Hosted AdSense for Content refers to You Tube adsense hits. 

AdSense for Search is search Engine hits 

AdSense for Content is your website content hits 

How can use Split function in C#

I want split 2009-2010 in year format like: 2009

INPUT :   2009-2010  (financialYear)

OUTPUT: 2009


  char[] splitter1 = { '-' };
            string[] year1 = financialYear.Split(splitter1);
            int str1 = Convert.ToInt32(year1[0].ToString());
         
str1 give result: 2009

Monday, September 10, 2012

BackButton-Disable by JavaScript code

<script language="JavaScript">
var ie = (window.navigator.appName == "Microsoft Internet Explorer") ? true : false;

function setEventByObject(object, event, func){
if (!ie){
object.addEventListener(event, func, false);
} else {
object.attachEvent("on" + event, func);
}
}

setEventByObject(win, "unload", exitme);
var block = "false";
function blockBackButton(){
block = "true";
}
function resetBackButton(){
block = "false";
}
function jumpforward(){
if(window.location.href.indexOf("&jumpforward")!=-1) {
history.forward();
}
}
jumpforward();
function exitme(){
if(block == "true") window.location.href += "&jumpforward";
}
</script>

Sunday, September 9, 2012

How can I copy something from a webpage to my webpage ?

Fetching data from another website to our web site.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Net;
using System.Web.Security;
using System.Web.UI.HtmlControls;
using System.Text;


namespace SBIWEB
{
    public partial class callwebpage : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            StreamWriter sms_writer = null;

            string str_request = "x=" + "y";

            Uri url = new Uri("http://webdigitalseo.com/");
            if (url.Scheme == Uri.UriSchemeHttp)
            {     //Create Request Object
                HttpWebRequest objRequest = (HttpWebRequest)HttpWebRequest.Create(url);
               // HttpWebRequest objRequest = (HttpWebRequest)HttpWebRequest.Create(url + str_request);
                //Set Request Method  
                //objRequest.Method = WebRequestMethods.Http.Post;
                objRequest.Method = "post";
                objRequest.ContentLength = str_request.Length;
                objRequest.ContentType = "application/x-www-form-urlencoded";
                sms_writer = new StreamWriter(objRequest.GetRequestStream());
                sms_writer.Write(str_request);
                sms_writer.Close();

                //Get response from requested url  
                HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
                //Read response in stream reader  
                StreamReader reader = new StreamReader(objResponse.GetResponseStream());
                string tmp = reader.ReadToEnd();
                objResponse.Close();     //Set response data to container  
                Response.Write(tmp);
            }
        }
    }
}

SQL Express 2008 R2 failed to install give error message the service did not start due to a logon failure.


If you are trying to install SQL Server Express 2008 R2, but I keep getting errors please learning to read the logs, the summary.txt provided in post or your system.   I tried following one post how can remove this issue in SQL server 2008 R2 version.
Follow given step in screen shot. If you face services did not start due to a logon failure in this case choose SYSTEM in place of Administrator login in install time.