Knowledge Base Category: Development

How to activate the administrator account in windows?

Go to start > run in previous versions of windows and type cmd then press [Enter] On Windows 7 just go to the Search Bar and type cmd then press [Enter] start
In the Black screen type   [tp no_translate="y"]
Net user administrator /active:yes
[/tp]
Then...
Read more

How to encrypt and decrypt

Sample code to Encrypt and Decrypt: Create a Sample WebSite  On the ASPX page place the following tags [tp no_translate="y"]
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <h1>Encryptor/Decryptor</h1>
        Enter Text:<asp:TextBox ID="txtencoded" runat="server" Height="53px" TextMode="MultiLine" Width="531px"></asp:TextBox>
    ... 						
						
Read more

SQL Complex Pivot

This is a sample for a complex pivot [tp no_translate="y"]
Declare @Employees table(id int,name varchar(40))
Insert Into @Employees 
Values (10,'John')
Insert Into @Employees 
Values (20,'Luis')
Insert Into @Employees 
Values (30,'Sebastian')
Insert Into @Employees 
Values (40,'Richard')
Insert Into @Employees 
Values (50,'Gonzalo')
Insert Into @Employees 
Values (60,'Leo')

Declare @MonthlySales Table(id int identity (1,1),empid int,totalsales int,salesdate datetime)
Insert into @MonthlySales
Values(10,15,'01/31/2012')
Insert into @MonthlySales
Values(10,2,'06/30/2011')
Insert into @MonthlySales
Values(10,4,'03/31/2010')
Insert into @MonthlySales
Values(20,5,'01/31/2012')
Insert into... 						
						
Read more

How to find a String in a Store Procedure?

The following code finds a string thru all store procedures
[tp no_translate="y"]
select p.name from sys.procedures p join 
syscomments c ON c.id=p.object_id
where text like '%TABLENAME%'
To search for a column name in a table use the following:
 Select t.name as tablename,c.* from sys.columns c 
 Join sys.tables t on c.object_id=t.object_id
 where c.name = 'Note'
[/tp]  ...
Read more