Wednesday, 26 June 2013

select from table distinct column

SELECT * FROM TABLE WITH DISTINCT COLUMN
---------------------------------------------------------------

SELECT * FROM [TABLE NAME]
WHERE [ID] IN (
  SELECT MIN([ID]) FROM [TABLE NAME] GROUP BY [DISTINCT COLUMN NAME])

Example:

       SELECT FROM [SKILLS] WHERE [ID] IN
       (
      SELECT MIN([ID]) FROM [SKILLS] GROUP BY [SKILL NAME]
       )

Friday, 21 June 2013

string split using jquery / java script

var a = "one,two,three".split(",") // Delimiter is a string
for (var i = 0; i < a.length; i++)
{
alert(a[i])
}

var b = "1+2=3".split(/[+=]/) // Delimiter is a regular expression
for (var i = 0; i < b.length; i++)
{
alert(b[i])
}

Friday, 14 June 2013

500 Internal Server Error” when adding HttpModule in my Web.config

use the following new module syntax made for IIS7 (godaddy is using IIS7 for windows hosting)
<configuration>
   <system.webServer>
      <modules>
         <add name="Header" type="Contoso.ShoppingCart.Header"/>
      </modules>
   </system.webServer>
</configuration>
here details about module tag  

Convert SVG to PNG using svg.dll

      <div id="divsvg">        <svg width="350" height="300"><defs></defs> ............