Wednesday 26 August 2015

Column ' ' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name
HAVING aggregate_function(column_name) operator value;




You are expecting one  column in select , but you are not adding at GROUP BY 

Saturday 22 August 2015

How to protect from cross site scripting attacks?"


The easiest way to protect yourself as a user is to only follow links from the main website you wish to view. If you visit one website and it links to CNN for example, instead of clicking on it visit CNN's main site and use its search engine to find the content. This will probably eliminate ninety percent of the problem. Sometimes XSS can be executed automatically when you open an email, email attachment, read a guestbook, or bulletin board post. If you plan on opening an email, or reading a post on a public board from a person you don't know BE CAREFUL. One of the best ways to protect yourself is to turn off Javascript in your browser settings. In IE turn your security settings to high. This can prevent cookie theft, and in general is a safer thing to do.

"Does encryption protect me?"

  Websites that use SSL (https) are in no way more protected than websites that are not encrypted. The web applications work the same way as before, except the attack is taking place in an encrypted connection. People often think that because they see the lock on their browser it means everything is secure. This just isn't the case.

A few facts about cross-site scripting attacks that you should be aware of are:

Every month roughly 10-25 XSS holes are found in commercial products and advisories are published explaining the threat.
Websites that use SSL (https) are in no way more protected than websites that are not encrypted. The web applications work the same way as before, except the attack is taking place in an encrypted connection.
XSS attacks are generally invisible to the victim.
All Web servers, application servers, and Web application environments are susceptible to cross-site scripting.


Risks Associated with Cross-Site Scripting
(What type of damages will happens because of XSS)

  • User accounts being stolen through session hijacking (stealing cookies) or through the theft of username and password combinations
  • The ability for attackers to track your visitors web browsing behavior infringing on their privacy
  • Abuse of credentials and trust
  • Keystroke logging of your site’s visitors
  • Misuse of server and bandwidth resources
  • The ability for attackers to exploit your visitor’s browser
  • Data theft
  • Web site defacement and vandalism
  • Link injections
  • Content theft

Tuesday 18 August 2015

How to install Mozilla Firefox 31.0esr


To view all versions...
https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/
To install 31.0esr
https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/31.0esr/
Click on Win32
https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/31.0esr/win32/
Click on en-US
https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/31.0esr/win32/en-US/
Click on
Firefox Setup 31.0esr.exe

Now you can install Mozilla Firefox 31.0esr

Friday 14 August 2015

Search for a keyword in multiple files

Open command prompt
Go to folder path where your files are there.
c:\abc>
Type below command.

 forfiles /D -1 |findstr /I /S /P /M SearchKeyword * >c:\temp\results.txt

Now you will see result file names under ::\temp\results.txt

Ex: c:\abc> forfiles /D -1 |findstr /I /S /P /M redmond * >c:\temp\results.txt

Thursday 13 August 2015

Notepad++ How to get new line

Notepad++
How to get new line
Find and replace Ex:Find | and replace with \r\n
Select Extended
Click Replace All.


Monday 10 August 2015

event viewer custom view

 private static void WriteToEvent(string source, string message, EventLogEntryType evtType, int id)
        {
            //Folder Name under Applications and Services Logs
            System.Diagnostics.EventLog objEventLog = new System.Diagnostics.EventLog(source);
            objEventLog.Source = source;
            objEventLog.WriteEntry(message, evtType, id);
        }

  WriteToEvent("MySource", "My Error  ", EventLogEntryType.Error, 1110);