Skip to main content

Posts

Showing posts from October, 2013

Hide Div tag By-Tanuj Kumar

Javascript Code to Show or Hide Div: This function can be done easily by java script program . <html> <head> <title>Javascript Program to Show/Hide Div Visibility</title> <script language="javascript" type="text/javascript"> function showHideDiv() { var divstyle = new String(); divstyle = document.getElementById("div1" ).style.visibility; if (divstyle.toLowerCase() == "visible" || divstyle == "") { document.getElementById("div1" ).style.visibility = "hidden"; } else { document.getElementById("div1" ).style.visibility = "visible"; } } </script> </head> <body> <div id="div1" class="divStyle"> Show/Hide Div tag using java script. </div> <cen

Transaction in .net By:Tanuj Kumar

Transaction Example in .Net Program: //first of all take button click event button click() { //create SqlConnection class object   SqlConnection con = new SqlConnection("Connnection string" ); SqlTransaction transaction; //open connection con.Open(); //begin transaction transaction = con.BeginTransaction(); try { new SqlCommand("INSERT INTO Transaction " + "(Text) VALUES ('Row1');", con, transaction) .ExecuteNonQuery(); new SqlCommand("INSERT INTO Transaction " + "(Text) VALUES ('Row2');", con, transaction) .ExecuteNonQuery(); new SqlCommand("INSERT INTO transaction2 VALUES " + "('Die', 'Die', 'Die');", con, transaction) .ExecuteNonQuery(); transaction.Commit(); } catch (SqlException sqlError) {

Find Prime No. Using Java Script By:Tanuj Kumar

Find Prime No. Using Java Script var num =prompt("Enter a number"); parseInt(num);var i;var b=0; if(num==1) { alert("A prime number is a number which has only two factors, 1, and itself. But in the case of 1, there is only one factor: 1. So, 1 is not a prime number"); } else{ for(i=1;i<=num;i++) { var result = num%i; if(result==0) { b++; } } if(b<=2) { alert("Prime no."); } else { alert("Not Prime"); } } Posted By:Tanuj Kumar  On:Shareyourconscience

Unhide all sheet in MS EXCEL 2010 Using Macro By:Tanuj Kumar

Unhide all sheets in MS Excel 2010 using Macros. Goto view>>Macros>>view macros>>create then copy paste the below code then save the sheet. Dim all_ws As Worksheet For Each all_ws In ActiveWorkbook.Worksheets all_ws.Visible = xlSheetVisible Next all_ws confirm to save. Now run the create Macros . Posted By:Tanuj Kumar  On:Shareyourconscience