Subhash Sharma

Subhash Sharma
Subhash Sharma

This is Subhash Sharma(Software Engineer) Blog

Welcome to this blog and find every solution.............

Search This Blog

Software Engineer(Subhash Sharma)

Software Engineer(Subhash Sharma)
Software Engineer

Wednesday, September 8, 2010

textbox value should not be more than 14 character and take only integer value

//textbox onblur Event

asp:TextBox ID="TextBox1" runat="server" onblur="Checktextboxlenth(this);">/asp:TextBox>



//.js file

function ValidateCCNum(ccNum)
{
var ccno = ccNum.value;
if(ccno == "")
{

return true;
}

if(isNaN(ccno))
{

alert("Credit card number should be numeric");
ccNum.value="";
ccNum.focus();

return false;
}


if(ccno.length < 14 || ccno.length >18)
{

alert("Credit card number should have 14-18 digits length");
ccNum.value="";
ccNum.focus();

return false;
}
return true;
}

text box will not take more than 5 character

//.js file

function Checktextboxlenth(ccNum)
{
var ccno = ccNum.value;
if(ccno.length < 0 || ccno.length >5)
{
alert("length cant acces 5 character");
return false ;
}

return true;
}

////onpageload

btnId1.Attributes.Add("onclick", "Checktextboxlenth(TextBox1)");

Tuesday, August 17, 2010

Find number of columns in a table in sql server 2000 and 2005 also

select count(*) NoOfColumns from SYSCOLUMNS
WHERE id= (Select id from SYSOBJECTS where name = 'emp')

What is live lock and deadlock? what is Lock escalation?

In SQL Server Live Lock occurs when read transactions are
applied on table which prevents write transaction to wait
indefinitely and Deadlocking occurs when two user processes
have locks on separate objects and each process is trying to
acquire a lock on the object that the other process has.

Lock escalation is the process of converting a lot of low
level locks (like row locks, page locks) into higher level
locks (like table locks).

What is OPENXML in SQL Server?

OPENXML can parse the xml data in SQL server very efficiently in SQL Server. OpenXML primarily gives the ability to insert XML data to the relational database, however we can query the data too using OpenXML. We need to specify the path of the xml element using xpath.

Convert Sql DataBase Tables to Xml

select * from emp for xml auto