<html>
<head>
<title>Demo</title>
<script type=”text/javascript”>
function textChanged(elm)
{
alert(elm.value);
}
onload = function()
{
var elm = document.getElementById(”mytextbox”);
elm.onchange = new Function(’textChanged(this)’);
[...]
Read Full Post »
<input type=”text” id=”mytb” />
To select: document.getElementById(”mytb”).select()
To unselect: document.getElementById(”mytb”).value = document.getElementById(”mytb”).value;
Just the value to itself. That’s all!
Read Full Post »
Posted in SQL, Uncategorized on April 25, 2008 | No Comments »
The query:
select
distinct type from sysobjects
FN: Scalar Valued Functions
P: Stored Procedures
U: Tables
TF Table Valued Functions
How to delete all of the same type?
use
mydb –replace by your own db name
GO
declare
@procName sysnamedeclare
someCursor cursor FORselect
name from sysobjects where type = ‘P’ AND objectproperty(id, ‘IsMSShipped’
= 0 order by name ascopen
someCursor
fetch
next from someCursor into @procName
while
[...]
Read Full Post »
GridViewRow pager = SearchResultsGridView.TopPagerRow;
if (pager != null)
{
[...]
Read Full Post »
Posted in SQL, Uncategorized on April 7, 2008 | No Comments »
DECLARE @Items VARCHAR(1000)
SET @Items = ‘A,B,CD,E,FGH,KL,MNOP,QRSTU,V,W,XYZ’
DECLARE @Item VARCHAR(50)
DECLARE @Pos INT
DECLARE @Loop BIT
SELECT @Loop = CASE WHEN LEN(@Items) > 0 THEN 1 ELSE 0 END
WHILE (SELECT @Loop) = 1
BEGIN
SELECT @Pos = CHARINDEX(’,’, @Items, 1)
IF @Pos > 0
BEGIN
SELECT @Item = SUBSTRING(@Items, 1, @Pos - 1)
SELECT @Items = SUBSTRING(@Items, @Pos + 1, LEN(@Items) - @Pos)
END
ELSE
BEGIN
SELECT @Item = @Items
SELECT [...]
Read Full Post »