Retrieving port number with sql query

Leave a comment



Declare @PortNumber VarChar(7)

Exec Xp_RegRead

@RootKey='HKEY_LOCAL_MACHINE',

@Key='Software\Microsoft\Microsoft Sql Server\SQLEXPRESS\MSSQLServer\SuperSocketNetLib\Tcp',

@Value_Name='TcpPort',

@Value=@PortNumber OutPut

Print 'Port Number:'

Print @PortNumber

When you execute this you will get a problem to enable XP_CMDshell.You can enable by this.Read the article at:
Enabling xp_cmdshell in SQL Server 2005

Advertisements

Retrieving IP address of a system with SQL Query

Leave a comment


Retrieving IP address of a system with SQL Query

CREATE PROCEDURE getIPAdress

(

@Hostname VARCHAR(255)

)

AS

SET NOCOUNT ON

CREATE TABLE #Results

(

Results VARCHAR(4000)

)

DECLARE @Commandstring VARCHAR(300)

SET @Commandstring = ‘ping ‘ + @Hostname

INSERT INTO #Results

EXEC master..xp_cmdshell @Commandstring

Select DISTINCT SUBSTRING(Results,12,CHARINDEX(‘:’,Results)-12) AS HostIpAdress from #Results

Where Results LIKE ‘Reply From%’

DROP TABLE #Results

GO
============================
To know result

exec getIPAdress ‘ABCXP10’

ABCXP10 is a system name

Blogged with Flock

Tags:

javascript with response.redirect

Leave a comment


Q) I had been trying to use javacript to alert some message and after that I do a response.redirect to another page.

But the alert message seems not appearing and it just redirect to another page.

A) use the below code.here we use location.replace

Location.replace

Syntax:
location.replace(URL)

The replace method replaces the current History entry with the specified URL. After calling the replace method, you cannot navigate back to the previous URL using the browser’s Back button.

Usage

string s = “alert(‘Your Profile Is Successfully Updated’);location.replace(‘Client_home.aspx’);”;
Page.ClientScript.RegisterStartupScript(this.GetType(), “sri”, s, true);

Blogged with Flock

Windows officelive website doesnt support safari web browser

1 Comment


When I am trying to open office live it is taking url as:
http://home.officelive.com/Misc/CompatibleShell.aspx?linkId=UnsupportedBrowser

It means office live not supporting safari web browser
https://home.officelive.com

View the screen shot at:
safari

Blogged with Flock

Links for Content Management system in ASP.NET

Leave a comment


Open source

http://www.dotnetnuke.com/
http://www.rainbowportal.net/
http://drupal.org/


http://aspalliance.com/simplecms/default.aspxhttp://www.codeplex.com/SampleCMS

http://www.codeplex.com/umbraco/Release/ProjectReleases.aspx?ReleaseId=6344

http://www.davidpirek.com/CMS/


http://graffiticms.com/
http://www.kentico.com/
http://www.axcms.net/en_axcms_home.AxCMS?ActiveID=1848

Blogged with Flock

Tags:

validate textbox with only numbers using Javascript code

16 Comments


We can validate textbox with only numbers by writing this Javascript code and calling at onkeypress event of text box

<!–
      function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
      }
      //–>

   <asp:TextBox ID=”txt_maxage” Onkeypress=”return isNumberKey(event)” runat=”server”></asp:TextBox>

Blogged with Flock

Tags:

Play music when mouse hovers on a link in ASP.NET

Leave a comment


Javascript code
============

Write this in .aspx page.

<script language=”JavaScript”><!–
// Sound on Mouseover javascript supplied by http://www.hypergurl.com

var aySound = new Array();
// PLACE YOUR SOUND FILES BELOW
aySound[0] = “sound002.wav”;
aySound[1] = “sound003.wav”;
aySound[2] = “sound004.wav”;
aySound[3] = “sound005.wav”;
aySound[4] = “sound006.wav”;
aySound[5] = “sound007.wav”;
aySound[6] = “sound008.wav”;
aySound[7] = “sound009.wav”;
aySound[8] = “sound010.wav”;
// Don’t alter anything below this line

IE = (navigator.appVersion.indexOf(“MSIE”)!=-1 && document.all)? 1:0;
NS = (navigator.appName==”Netscape” && navigator.plugins[“LiveAudio”])? 1:0;
ver4 = IE||NS? 1:0;
onload=auPreload;

function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = “<DIV ID=’auEmb’ STYLE=’position:absolute;’></DIV>”;
document.body.insertAdjacentHTML(“BeforeEnd”,Str);
}
var Str = ”;
for (i=0;i<aySound.length;i++)
Str += “<EMBED SRC='”+aySound[i]+”‘ AUTOSTART=’FALSE’  LOOP=’TRUE’ HIDDEN=’TRUE’>”
if (IE) auEmb.innerHTML = Str;
else {
auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close();
}
auCon = IE? document.all.soundfiles:auEmb;
auCon.control = auCtrl;
}
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:”;
else eval(“this.document.embeds[whSound].” + (play? “play()”:”stop()”))
}
function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
//–></script>
<!– –>


=============
Code in ASP.NET
=============

<td width=”51%” valign=”top”  class=”nav”><div><a href=”#” class=”htext2″ onmouseover=”playSound(0)” onmouseout=”stopSound(0)”>&ndash; Command Altitude<br />
          </a>
              <br />
          <a href=”#” class=”htext2″ onmouseover=”playSound(2)” onmouseout=”stopSound(2)”>&ndash;Command Heading</a><br />
              <br />
          </div>
            <div><a href=”#” class=”htext2″ onmouseover=”playSound(3)” onmouseout=”stopSound(3)”>&ndash;Command Speed</a>
                <br />
              <br />
              <a href=”#” class=”htext2″ onmouseover=”playSound(4)” onmouseout=”stopSound(4)”>&ndash;Override</a> </div>
          </td>
          <td width=”51%” valign=”top”  class=”nav”><div><a href=”#” class=”htext2″ onmouseover=”playSound(5)” onmouseout=”stopSound(5)”>&ndash;Permanent   Override<br />
          </a>
              <br />
          </div>
              <div><a href=”#” class=”htext2″ onmouseover=”playSound(6)” onmouseout=”stopSound(6)”>&ndash;Temporary Override</a><br />
                  <br />
              </div>
            <div class=”htext2″>&ndash;<a href=”#” class=”htext2″ onmouseover=”playSound(7)” onmouseout=”stopSound(7)”>Cruise</a><br />
            </div>
            <div>
                <br />
                <a href=”#” class=”htext2″ onmouseover=”playSound(8)” onmouseout=”stopSound(8)”>&ndash;Manual Heading</a></div></td>
        </tr>
      </table>
    </td>

Any doubts mail me:  radhek@gmail.com

Blogged with Flock

Tags: ,

Older Entries

%d bloggers like this: