Translate

Wednesday 31 December 2014

Disable Right Click of Page in c#

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Sample to Disable Right Click of Page</title>
<script language="JavaScript" type="text/javascript">
    //Message to display whenever right click on website
    var message = "Sorry, Right Click have been disabled.";
    function click(e) {
        if (document.all) {
            if (event.button == 2 || event.button == 3) {
                alert(message);
                return false;
            }
        }
        else {
            if (e.button == 2 || e.button == 3) {
                e.preventDefault();
                e.stopPropagation();
                alert(message);
                return false;
            }
        }
    }
    if (document.all) {
        document.onmousedown = click;
    }
    else {
        document.onclick = click;
    }
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
from Suresh
-----

Monday 29 December 2014

Sunday 21 December 2014

sql server restore database query

RESTORE DATABASE PabitraDemoDb

FROM DISK='d:\PabitraDemoDb.bak'

code sample for windows form

Code sample for windows form
From Microsoft...
Click here for see More sample Code
http://msdn.microsoft.com/en-us/library/aa287561%28v=vs.71%29.aspx

Monday 15 December 2014

inserted trigger in sql server


CREATE TABLE [dbo].[tblTRIGGERMAST1](
[ID] [varchar](10) NOT NULL PRIMARY KEY,
[NAME] [varchar](20) NULL,
[PHONE] [int] NULL
)

CREATE TABLE [dbo].[tblTRIGGER2](
[ID] [int] IDENTITY(1001,1) PRIMARY KEY NOT NULL,
[IDMAST] [varchar](10) NULL,
[PHONE] [int] NULL,
[DATE] [datetime] NULL
)
CREATE  TRIGGER Triger_On_tblTRIGGERMAST1
ON  tblTRIGGERMAST1
AFTER INSERT
AS
BEGIN

SET NOCOUNT ON;
declare @ID int
declare @Phone int
declare @Result varchar(100)
select @ID=ID from inserted
select @Phone =PHONE from inserted
INSERT INTO tblTRIGGER2(IDMAST,PHONE)VALUES(@ID,@Phone)
set @Result=convert(varchar,'The Inserted Values Are Inserted in Table tblTRIGGER2:ID IS:  ')
+convert(varchar,@ID)+convert(varchar,' pHONE nO  Is: ')+convert(varchar,@Phone)
Print @Result

END
insert into tblTRIGGERMAST1(ID,NAME,PHONE)values(1004,'PABITRA BEHERA',828989)

-------------
---THE RESULT WILL BE
The Inserted Values Are Insert1004 pHONE nO  Is: 828989

(1 row(s) affected)

Friday 12 December 2014

Create a Full Database Backup In SQL Server

Create a Full Database Backup  In SQL Server



BACKUP DATABASE DataBaseName TO DISK = 'D:\BackupName.bak'
Example
DataBase name:DbPabitra
BACKUP DATABASE DbPabitra TO DISK = 'D:\DataBaseBacup.bak'
For More Informatation
http://pabitramicrosoftresearch.blogspot.in/