Monday 8 September 2014

[SOLVED]Hide DIV when click outside with jQuery

Use this in jquery or view(inside the script tag)

 $('body').click(function(){
    $('div').hide();
});

Its working.

Happy coding.

Tuesday 2 September 2014

Solved: The remote server returned an error: (417) Expectation Failed.

Simple solution for this error is,

open your web.config file then add this this configuration on it.

<system.net>
    <settings>
      <servicePointManager expect100Continue="false" />
    </settings>
  </system.net>

Happy Coding ;)

Tuesday 29 July 2014

Syntax Difference between MS Sql and My Sql

please check the following links,

http://vijaymodi.wordpress.com/2007/11/24/syntax-difference-between-ms-sql-and-my-sql/

http://www.mssqltips.com/sqlservertutorial/2204/mysql-to-sql-server-coding-differences/

Monday 28 July 2014

Add primary key constraint in MySql syntax

syntax for an primary key in My Sql

Create Table tablename
(
      [columnname] [datatype] [columnconstraint] [table constraint] [column name]
);


Example:

Create Table Table1
(
      ID Not Null auto_Increment,
      Name varchar(256) ,
      primary key (ID)
);

Happy Scripting :)

Friday 20 June 2014

Add new column in existing table with default value in sql server

To perform this process just follow this,


Syntex:

Alter table <table_Name>
Add column <column_Name> null/not null default


Query:

let say user table has column username,password. now i am adding createdon(date), to achieve this

Alter table user
add column createdon null default(getdate())


Result:
along with existing data new column will added as well as value also.

happy coding :)

Thursday 12 June 2014

Difference Between Sql Server VARCHAR and NVARCHAR Data Type

Refer this following link

http://sqlhints.com/2011/12/23/difference-between-varchar-and-nvarchar/

http://social.msdn.microsoft.com/Forums/en-US/b6615caa-629b-45ac-9710-aab7f6e172b3/varchar-and-nvarchar-use-what-is-exact-difference-between-these?forum=sqldataaccess

Monday 12 May 2014

How to retrieve binary image from database using C# in ASP.NET

Please follow these steps:


Step1: In aspx page add a image control 


<asp:Image ID="img" runat="server"  />

Step2: In code behind add the following code 


protected void Page_Load(object sender, EventArgs e)
        {
            string strCon = ConfigurationManager.ConnectionStrings["DB"].ConnectionString;
            SqlConnection con = new SqlConnection(strCon);
            SqlCommand cmd = new SqlCommand("getimage", con);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            con.Open();
            if (con.State== ConnectionState.Open)
            {
                cmd.ExecuteNonQuery();
                DataTable dt = new DataTable();
                da.Fill(dt);
                byte[] image = (byte[])dt.Rows[0][0];
                img.ImageUrl = "data:image/png;base64 ," + Convert.ToBase64String(image, 0, image.Length);
            }
           

        }

Step3: In Web.config


<add name="DB"
         connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=dbname;Data Source=servername;"
         providerName="System.Data.SqlClient" />

Monday 28 April 2014

how to get nth highest and lowest salary in sql server

Ex Code: Lowest case :

select top 1 column as 'salary' from (select distinct top 4 column from  Table order by ID asc) a order by ID desc

Highest Case:

select top 1 column as 'salary' from (select distinct top 4 column from  Table order by ID desc) a order by ID asc

Tuesday 1 April 2014

linq get second highest number or salary

Use this query:

var employees = Employees
    .GroupBy(e => e.Salary)
    .OrderByDescending(f => f.Key)
    .Skip(1).Take(1)
    .First();

Friday 28 March 2014

how to count number of online users in asp.net

Simple two steps:

1.Add this code in Global.asax


void Application_Start(Object Sender, EventArgs E)
        {
            Application["CurrentUsers"] = 0;
        }
        void Session_OnStart(object Sender, EventArgs E)
        {
            Application.Lock();
            Application["CurrentUsers"] = System.Convert.ToInt32(Application["CurrentUsers"]) + 1;
            Application.UnLock();
        }
        void Session_OnEnd(object Sender, EventArgs E)
        {
            Application.Lock();
            Application["CurrentUsers"] = System.Convert.ToInt32(Application["CurrentUsers"]) - 1;
            Application.UnLock();
        }

2.In Aspx Page

<%=Application["CurrentUsers"].ToString()%>

In web.config timeout will be make 10, by default 20

Friday 21 March 2014

hex code for checkbox and apply to css

HEX Code for check box is :
                         Checked :2610,
                    Un Checked :2611.

In Css
.checked:before
{
    content:"\2611";
    }
in Aspx page or html page or View

<a href="#" class="checked"></a>

Tuesday 11 March 2014

dynamic menu li selected item highlighted using jquery or javascript

Use the following steps for archiving li selected item highlited.

Loop Code :1

@foreach (class obj in list)
        {
            <ul>
                <li  class="@obj.strName" style="font-weight:bold;" ><a href="#"  style="text-decoration:none;" >
 </a></li>
            </ul>
        }

Css: 2
.li
    {      
        background-color:#bb0d2d !important;
        color: white !important;      
    }

JQuery: 3
$('li').click(function () {
        $(this).addClass('li');
    });

Wednesday 5 March 2014

default button in html using jquery

use this steps:
Html or aspx or View
create textbox and button in the page and assign id,

Then,

JQUERY

$("#textboxID").keyup(function (event) {
        if (event.keyCode == 13) {
            $("#buttonID").click();
        }
    });

Thursday 27 February 2014

html.actionlink target _blank

@Html.ActionLink("string name", "Actionname", "Controllername", "", new { target = "_blank" })

this code working fine.

Wednesday 19 February 2014

read resource file in asp.net

Step:1

Add resource file in your application

step:2

create a page for input text and output result label.

step:3

in code behind add this line

System.Resources.ResourceManager rm = new System.Resources.ResourceManager("Yourresourcefilenamespace.resourcefilename(without extention.resx)", this.GetType().Assembly);
        It cerates reslult set      
                var entry =
                    rm.GetResourceSet(System.Threading.Thread.CurrentThread.CurrentCulture, true, true)
                      .OfType<System.Collections.DictionaryEntry>().Where(e => e.Key.ToString() == "input text").Select(v=>v.Value);
      for single row
 var entry =
                    rm.GetResourceSet(System.Threading.Thread.CurrentThread.CurrentCulture, true, true)
                      .OfType<System.Collections.DictionaryEntry>().FirstOrDefault(e => e.Key.ToString() == "your text");
                     

                var key = entry.Value.ToString();

Monday 10 February 2014

httpcontext.current namespace for asp.net mvc

simple change in this
instead of this line 

HttpContext context = HttpContext.Current;

change to
HttpContext context = System.Web.HttpContext.Current;

dont forgot to add using system.web;   namespace in the page in mvc Application.

Thursday 23 January 2014

prometric centers in bangalore

List of prometric centers in bangalore:


 LEARNING LABS PVT LIMITED
LEARNING LABS PVT LIMITED
# 1, HIRANYA COMPLEX,
AIRPORT ROAD, DOMLUR
(ABOVE HAIKU HONDA SHOWROOM)
BANGALORE, Karnataka 560071
Phone: 41262390/41265144
Site Code: IIH7
 NIIT LTD.JAYANAGAR-BANGALORE
NIIT LTD
75, 8TH E-MAIN, 4TH-BLOCK
JAYNAGAR
BANGALORE, Karnataka 560011
Phone: 51211090
Site Code: IIN32
 NIIT LTD – KORAMANGALA
NIIT LTD – KORAMANGALA
143-B,1ST FLOOR, 60 FEET ROAD
5TH BLOCK, NEAR ANAND SWEETS
KORAMANGALA
BANGALORE, Karnataka 560095
Phone: 080-41303291
Site Code: IIN40
 SQL STAR INTERNATIONL LTD-BANGALORE
40/4, 3rd FLOOR,
LAVELLE ROAD
BANGALORE, Karnataka 560001
Phone: 2227781
Site Code: IIU2
 CARTEL NETWORK SOLUTIONS (P) LTD.
986,41 ST CROSS3RD BLOCK
RAJAJINAGAR
Opp ESI Hospital
BANGALORE, Karnataka 560010
Phone: 9845023146
Site Code: IIH23
 ROOMAN TECHNOLOGIES
130 1ST BLOCK
RAJKUMAR ROAD
RAJAJINAGAR
BANGALORE, Karnataka 560010
Phone: 23127771
Site Code: IIH37
 NIIT LTD-VIJAYA NAGAR-BANGALORE
2934/E-II FLOOR
MAGADI CHORD ROAD
ABOVE FOOD WORLD
VIJAYANAGAR II STAGE
BANGALORE, Karnataka 560040
Phone: 41270768/41270769
Site Code: IIN34
 APTECH COMPUTER EDUCATION
6TH FLOOR C WING
MITTAL TOWERS
MG ROAD
BANGALORE, Karnataka 560001
Phone: 80-25585542
Site Code: IIO19
Vinsys IT Services
1st main BTM layout 100ft Ringroad,
Near Friends resturant,
Bangalore 5600068
Karnataka
Call Us:080-41550745.
Mobile : +91 9986074882.
Email us at: vikram.patil@vinsys.in.
Website :www.vinsys.in
SureSuccess
3rd Floor, Siteno. 8/2 (OldNo9)
Brook Field Main Road,
Near HDFC Bank,HyperCity Mall
Bangalore 560037
Karnataka
Call Us:080 4227 4295.
Mobile : +91 8105820111.
Email us at: service@getsuresuccess.com.
CMS Institute Jayanagar
CMS Info Systems Pvt Ltd.
# 610 Vandna Arcade , 3rd Flore
10th A main Road Jayanagar 4th Block
Bangalore 560011
(Near to Masjid)
Ph: 9986690134
Mail: ajay_singh@cmsinstitute.co.in
 Asna Institute of Hardware Technology Pvt. Ltd.
#346/36, 1st Florr, H.M.T Main Road,
Opps.Subbaiah Hospital, Mathikere,
Bangalore-560054
Phone: 080-23378342
site code: II127
 RENAISSANCE INFOTECH
307 ,GROUND FLOOR, 18TH CROSS
6TH MAIN, MALLESWARAM
BANGALORE, Karnataka 560055
Phone: 080-2344 9427/28
Site Code: II66
 NIIT LTD
Vijayanagar
Address : No. 2934/E & 2935/E,
III Floor,Magadi Rd,
Vijayanagar II Stage,
Bangalore – 560 040
Landline : 080-30582764
Mobile : +91 99641 44096
 MICRO ACADEMY (I) PVT. LTD.
#72, Keonics Electronics City
Hosur Main Road
BANGALORE, Karnataka 560100
Phone: 080-51381749
Site Code: IID68
 IIHT LIMITED-INFANTRY ROAD-BANGALORE
63, OPP. SALEEH AHMED
INFANTRY ROAD
BANGALORE, Karnataka 560001
Phone: 080-25598351
Site Code: IIF23
 R.C.S. EDUCATION PVT LTD
127, 4TH FLOOR
ANCHORAGE COURT
OPP BRIGADE TOWERS
BRIGADE ROAD
BANGALORE, Karnataka 560025
Phone: 080-25361911
Site Code: IIF16
 Q-SOFT Systems & Solutions (P) Ltd.
252, First Floor
Kanakapura Road
Jaya Nagar 7th Block
Bangalore, Karnataka 560 082
Phone: 26340507/26639207
Site Code: IIF51
 NCT TRAINING PVT LTD
NO 2 2ND FLOOR MUNISWAMAPPA RD
NEXT TO POLICE STATION
J. C. NAGAR
BANGALORE, Karnataka 560006
Phone: 080-41285393
Site Code: IIF79
NEW HORIZON INDIA LIMITED-DICKENSEN ROAD-BANGALORE
N-101, NORTH BLOCK, MANIPAL CENTER
47 DICKENSEN ROAD
BANGALORE, Karnataka 560041
Phone: 25595380
Site Code: IIG19
 NEW HORIZON INDIA LIMITED-DICKENSEN ROAD-BANGALORE
UNIT #401, MONEY POINT
4TH FLOOR, #59
KH ROAD (DOUBLE ROAD)
EMERALD SYSTEMS
BANGALORE, Karnataka 560027
Phone: 080-22483919
Site Code: IIG2
 iDOMAINS TECHNOLOGIES
No.65, First Floor,KHB Colony,
2nd A Cross,5th Block,
Koramangala,Behind Wipro K1
Building,Near JyotiNivas Coleg
BANGALORE, Karnataka 560095
Phone: 4121613041102030
Site Code: IIG24
 INFOSYS TECHNOLOGIES LTD( Only for Infosys Employees)
ELECTRONICS CITY
HOSUR ROAD
BANGALORE, Karnataka
Phone: 080-28520261
Site Code: IIG4
 GALAXY INFORMATION TECHNOLOGIES
#3346/A,1-FLOOR,13TH CROSS
BANASHANKARI
2ND STAGE
BANGALORE, Karnataka 560070
Phone: 80-55333187
Site Code: IIG60
 DAKSHIN TECHNOLOGIES
GVS COMPLEX ,NO 296 2ND FLOOR
22ND CROSS,10TH MAIN,3RD BLOCK
(OPP.TO COSMOPOLITAN CLUB)
JAYANAGAR
BANGALORE, Karnataka 560011
Phone: 080-30934868
Site Code: IIG80
 IIHT LTD – JAYANAGAR-BANGALORE -(FRANCHISEE)
SOLUTIONS INTEGRATED-FRANCHISE
#74,1-FLOOR,KESHAVA KRUPA.10-M
30TH CROSS,4TH BLOCK
JAYANAGAR
BANGALORE, Karnataka 560011
Phone: 22457577
Site Code: IIG95
IIHT-BANGALORE-(FRANCHISE)
IT HARBOUR SOLUTIN LTD
# 101, ESTEEM PLAZA
ABOVE COFFEE DAY
SADASHIVNAGAR,
BANGALORE, Karnataka 560080
Phone: 41137700/01/02
Site Code: IIG98