Tuesday, November 27, 2007

javascript utilitys



disambler



dotnet code generator


Web templates



web templates


http://www.templatesbox.com/premium-templates/website-templates/template354.htm
http://www.templateyes.com
http://templates4net.com/template_details.php?id=77
http://www.lady-beetle.com/component/option,com_virtuemart/page,shop.browse/category_id,14/Itemid,56/
http://www.adesdesign.net/php/free_templates.php
http://www.flash-design-marketing.com/templates/free-templates.html
http://www.flashtemplatezone.com/
http://www.rickyswebtemplates.com/webtemplates.htm
http://winnerweb.org/4.html

Fixed header solution

 
 
 
**********************************************************************************************************************************************
 
Append this header style to whichever column needs to be frozen
===============================================================
 
<HeaderStyle BorderColor="Black" CssClass="frozenTop" />
 

The division "<div>" which contains the grid needs to be given the below CSS class
==================================================================================
 
<div id="divRSM" runat="server" class="tableContainer">
 
 
 
In the CSS file add this code (This can be modified accrdng to the project standards)
===========================================================================
 
/* Fixed Header Table Styles */
/* define height and width of scrollable area. Add 16px to width for scrollbar */
div.tableContainer
{
 clear: both;
 border: 1px solid #666666;
 margin:0px;
 padding:0px;
 width:100%;
 height:200px;
 position:relative;
}
 
 
 
Add the below style to the master page
======================================
 
<style type="text/css">
.frozenTop {
top:expression(this.offsetParent.scrollTop); position:relative;
z-index:2;
color:#000000;
font-weight: bold;
background-color:#4AC6E0;
height:25px;
padding-left:5px;
padding-right:5px;text-align:center;
border-left-width:1px;
border-right-width:0px;
border-bottom-width:0px;border-top-width:0px;
}
</style>
 

Int Qs

#61607;    .NET

-    Difference between asp and asp.net
-    How do you do exception management
-    If you are using components in your application, how can you handle exceptions raised in a component
-    Can we throw exception from catch block
-    How do you relate an aspx page with its code behind page
-    What are the types of assemblies and where can u store them and how
-    What is difference between value and reference types
-    Is array reference type / value type
-    Is string reference type / value type
-    What is web.config. How many web.config files can be allowed to use in an application
-    What is differnce between machine.config and web.config
-    What is shared and private assembly
-    What are asynchronous callbacks
-    How to write unmanaged code and how to identify whether the code is managed / unmanaged.
-    How to authenticate users using web.config
-    What is strong name and which tool is used for this
-    What is gacutil.exe. Where do we store assemblies
-    Should sn.exe be used before gacutil.exe
-    What does assemblyinfo.cs file consists of
-    What is boxing and unboxing
-    Types of authentications in ASP.NET
-    difference between Trace and Debug
-    Difference between Dataset and DataReader
-    What is custom tag in web.config
-    How do you define authentication in web.Config
-    What is sequence of code in retrieving data from database
-    About DTS package
-    What provider ADO.net use by default
-    Where does web.config info stored? Will this be stored in the registry?
-    How do you register the dotnet component or assembly?
-    Difference between asp and asp.net
-    Whis is stateless asp or asp.net?
-    Authentication mechanism in dotnet
-    State management in asp.net
-    Types of values mode can hold session state in web.config
-    About WebService
-    What are Http handler
-    What is view state and how this can be done and was this there in asp?
-    Types of optimization and name a few and how do u do?
-    About DataAdapters
-    Features of a dataset
-    How do you do role based security
-    Difference between Response.Expires and Expires.Absolute
-    Types of object in asp
-    About duration in caching technique
-    Types of configuration files and ther differences
-    Difference between ADO and ADO.net
-    About Postback
-    If you are calling three SPs from a window application how do u check for the performance of the SPS

#61607;    Database

-    What is normalization
-    What is an index and types of indexes. How many number of indexes can be used per table
-    What is a constraint. Types of constraints
-    What are code pages
-    What is referential integrity
-    What is a trigger
-    What are different types of joins
-    What is a self join
-    Authentication mechanisms in Sql Server
-    What are user defined stored procedures.
-    What is INSTEAD OF trigger
-    Difference between SQL server 7.0 and 2000
-    How to optimize a query that retrieves data by joining 4 tables
-    Usage of DTS
-    How to disable an index using select query
-    Is non-clustered index faster than clustered index
-    Types of optimization in querries
-    Difference between ISQL and OSQL
-    How you log an exception directly into sql server  what is used for this
-    About Replication in Database
-    What is the default optimization done in oracle and sql server
-    How can i make a coulmn as unique
-    How many no of tables can be joined in same sql server
-    How many coulmns can exist per table
-    About Sql Profiler usage

•    HR & Project

-    About yourself
-    About work experience
-    How long you are working on .NET
-    Are you willing to relocate
-    When will you join   
-    Why do u what to change from current organization
-    Why do you want to join Accenture
-    What are your weaknesses / areas of improvement
-    What is your current project and your responsibilities
-    Have you done database design / development
-    What is D in ACID

#61656;    Microsoft

•    HR (Screening)
-    Tell about yourself
-    Tell about your work experience
-    Tell about projects
-    Tell about your current project and your role in it
-    What is your current salary p.a .

•    Technical

#61607;    .NET
-    How do you manage session in ASP and ASP.NET
-    How do you handle session management in ASP.NET and how do you implement them. How do  you handle in case of SQLServer mode.
-    What are different authentication types. How do  you retreive user id in case of windows authentication
-    For a server control, you need to have same properties like color maxlength, size, and allowed character throughout the application. How do you handle this.
-    What is custom control. What is the difference between custom control and user control
-    What is the syntax for datagrid and specifying columns
-    How do you add a javascript function for a link button in a datagrid.
-    Does C# supports multi-dimensional arrays
-    How to transpose rows into columns and columns into rows in a multi-dimensional array
-     What are object oriented concepts
-    How do you create multiple inheritance in C#
-    ADO and ADO.NET differences
-    Features and disadvantages of dataset
-    What is the difference between and ActiveX dll and control
-    How do you perform validations
-    What is reflection and disadvantages of reflection
-    What is boxing and how it is done internally
-    Types of authentications in IIS
-    What are the security issues if we send a query from the application
-    Difference between ByVal and ByRef
-    Disadvantages of COM components
 
-    How do we invoke queries from the application
-    What is the provider and namespaces being used to access oracle database
-    How do you load XML document and perform validation of the document
-    How do you access elements in XML document
-    What is ODP.NET
-    Types of session management in ASP.NET
-    Difference between datareader and dataset
-    What are the steps in connecting to database
-    How do you register a .NET assembly
-    Usage of web.config
-    About remoting and web services. Difference between them
-    Caching techniques in .NET
-    About CLS and CTS
-    Is overloading possible in web services
-    Difference between .NET and previous version
-    Types of chaching. How to implement caching
-    Features in ASP.NET
-    How do you do validations. Whether client-side or server-side validations are better
-    How do you implement multiple inheritance in .NET
-    Difference between multi-level and multiple inheritance
-    Difference between dataset and datareader
-    What are runtime hosts
-    What is an application domain
-    What is viewstate
-    About CLR, reflection and assemblies
-    Difference between .NET components and COM components
-    What does assemblyinfo.cs consists
-    Types of objects in ASP

#61607;    Database

-    What are the blocks in stored procedure
-    How do you handle exceptions. Give the syntax for it
-    What is normalization and types of normalization
-    When would you denormalize
-    Difference between a query and strored procedure
-    What is clustered and non-clustered indexes
-    Types of joins
-    How do you get all records from 2 tables. Which join do you use
-    Types of optimization
-    Difference between inline query and stored procedure

#61607;    Project related
-    Tell about your current project
-    Tell about your role
-    What is the toughest situation you faced in the development
-    How often you communicate with the client
-    For what purposes, you communicate with the client
-    What is the process followed
-    Explain complete process followed for the development
-    What is the life cycle model used for the development
-    How do communicate with team members
-    How do you say you are having excellent team management skills
-    If your client gives a change and asks for early delivery. How will you manage.
-     How will gather requirements and where do you record. Is it in word / Excel or do you have any tool for that
-    What is the stage when code is delivered to the client and he is testing it.
-    What are the different phases of SDLC
-    How do you handle change requests
-    How do you perform impact analysis
-    How do you write unit test cases.
-    About current project architecture

#61656;    Keane on 12th October 2003

•    Technical

#61607;    .NET
-    Write steps of retrieving data using ado.net
-    Call a stored procedure from ado.net and pass parameter to it
-    Different type of validation controls in asp.net
-    Difference between server.Execute and response.redirect
-    What is Response.Flush method
-    How Response.flush works in server.Execute
-    What is the need of clinet side and server side validation
-    Tell About Global.asax
-    What is application variable and when it is initialized
-    Tell About Web.config
-    Can we write one page in c# and other in vb in one application
-    When web.config is called
-    How many web.config a application can have
-    How do you set language in web.cofig


#61607;    Database
-    How do you rate yourrself in oracle and sql server
-    What is E-R diagram
-    Draw E-R diagram for many to many relationship
-    Design databaseraw er diagram for a certain scenario(many author many books)
-    Diff between primary key and unique key
-    What is Normalization
-    Difference between sub query and nested query
-    Indexes in oracle
-    Querry to retrieve record for a many to many relationship
-    Querry to get max and second max in oracle in one querry
-    Write a simple Store procedure and pass parameter to it

#61656;    Digital Globalsoft

•    Technical

#61607;    .NET
-    Difference between VB dll and assemblies in .NET
-    What is machine.config and web.config
-    Tell about WSDL
-    About web methods and its various attributes
-    What is manifest
-    Types of caching
-    What does connection string consists of
-    Where do you store connection string
-    What is the difference between session state and session variables
-    How do you pass session values from one page to another
-    What are WSDL ports
-    What is dataset and tell about its features. What are equivalent methods of previous, next etc. Of ADO in ADO.NET
-    What is abstract class
-    What is difference between interface inheritance and class inheritance
-    What are the collection classes
-    Which namespace is used for encryption
-    What are the various authentication mechanisms in ASP.NET
-    What is the difference between authentication and autherization
-    What are the types of threading models
-    How do you send an XML document from client to server
-    How do you create dlls in .NET
-    What is inetermediate language in .NET
-    What is CLR and how it generates native code
-    Can we store PROGID informatoin in database and dynamically load the component
-    Is VB.NET object oriented? What are the inheritances does VB.NET support.
-    What is strong name and what is the need of it
-    Any disadvantages in Dataset and in reflection
-    Advantage of vb.net over vb
-    What is runtime host
-    How to send a DataReader as a parameter to a remote client
-    How do you consume a webservice
-    What happens when a reference to webservice is added
-    How do you reference to a private & shared assembly
-    What is the purpose of System.EnterpriseServices namespace
-    About .Net remoting
-    Difference between remoting and webservice
-    Types of statemanagement techniques
-    How to register a shared assembly
-    About stateless and statefull webservice
-    How to invoke .net components from com components,give the sequence
-    How to check null values in dataset
-    About how soap messages are sent and received in webservice
-    Error handling and how this is done
-    Features in .net framework 1.1
-    Any problem found in vs.et
-    Optimization  technique description
-    About disco and uddi
-    What providers does ado.net uses internally
-    Oops concepts
-    Disadvantages of vb
-    XML serialization
-    What providers do you use to connect to oracle database?

#61607;    Database
-    Types of joins

#61607;    General
-    What are various life cycle model in S/W development

#61656;    Infosys

•    Technical

#61607;    .NET
-    How do you rate yourself in .NET
-    What is caching and types of caching
-    What does VS.NET contains
-    What is JIT, what are types of JITS and their pupose
-    What is SOAP, UDDI and WSDL
-    What is dataset

#61607;    Database
-    How do you optimize SQL queries

#61607;    General
-    Tell about yourself and job
-    Tell about current project
-    What are sequence diagrams, collaboration diagrams and difference between them
-    What is your role in the current project and what kinds of responsibilites you are handling
-    What is the team size and how do you ensure quality of code
-    What is the S/W model used in the project. What are the optimization techniques used. Give examples.
-    What are the SDLC phases you have invloved

#61656;    Satyam

•    Technical

#61607;    .NET
-    Types of threading models in VB.net
-    Types of compatability in VB and their usage
-    Difference between CDATA and PCDATA in XML
-    What is Assync in XML api which version of XML parser u worked with
-    Types of ASP objects
-    Difference between application and session
-    What is web application virtual directory
-    Can two web application share a session and application variable
-    If i have a page where i create an instance of a dll and without invoking any method can I send values to next page
-    Diffeernce between Active Exe and /Dll
-    Can the dictionary object be created in client's ccope?
-    About MTS and it's purpose
-    About writting a query and SP which is better
-    I have a component with 3 parameter and deployed to client side now i changed my dll method which takes 4 parameter.How can i deploy this without affecting the clent's code
-    How do you do multithreading application in VB
-    About Global .asax
-    Connection pooling in MTS
-    If cookies is disabled in clinet browser will session work
-    About XLST
-    How do you attach an XSL to an XML in presenting output
-    What is XML
-    How do you make  your site SSL enabled
-    Did you work on IIS adminisdtration
-    
#61607;    Database
-    dd
#61607;    General
-    dd
•    HR
-    About educational background
-    About work experience
-    About area of work
-    Current salary, why are looking for a change and about notice period
-    About company strength, verticals, clients, domains etc.
-    Rate yourself in different areas of .NET and SQL

#61656;    Cognizent

•    Technical

#61607;    .NET
-    About response.buffer and repsonse.flush
-    About dataset and data mining
-    About SOAP
-    Usage of htmlencode and urlencode
-    Usage of server variables
-    How to find the client browser type
-    How do you trap errors in ASP and how do you invoke a component in ASP
#61607;    Database
-    About types of indexes in SQL server
-    Difference between writing SQL query and stored procedure
-    About DTS usage
-    How do you optimize Sql queries

#61607;    General
-    Dfs
-    Rate yourself in .NET and SQL
-    About 5 processes
-    About current project and your role
•    HR
-    About educational background, work experience, and area of work
-    


#61656;    TCS

•    Technical

#61607;    .NET
-    Define .NET architecture
-    Where does ADO.NET and XML web services come in the architecture
-    What is MSIL code
-    Types of JIT and what is econo-JIT
-    What is CTS, CLS and CLR
-    Uses of CLR
-    Difference between ASP and ASP.NET
-    What are webservices, its attributes. Where they are available
-    What is UDDI and how to register a web service
-    Without UDDI, is it possible to access a remote web service
-    How a web service is exposed to outside world
-    What is boxing and unboxing
-    What is WSDL and disco file
-    What is web.config and machine.config
-    What is difference between ASP and ASP.NET
-    What is dataset and uses of dataset
-    What does ADO.NET consists of?
-    What are various authentication mechanisms in ASP.NET
-    What do you mean by passport authentication and windows authentication
-    What is an assembly and what does manifest consists
-    What is strong name and what is the purpose of strong name
-    What are various types of assemblies
-    Difference between VB.NET and C#. Which is faster
-    Types of caching
-    How WSDL is stored
-    What is the key feature of ADO.NET compared to ADO
-    How does dataset acts in a disconnected fashion
-    Does the following statement executes successfully:
Response.Write("value of i =  " + i);
-    What is ODP.NET
-    What are the providers available with VS.NET
-    What is a process
-    What is binding in web service
-    How a proxy is generated for a web service
-    About delegates
-    What are static assemblies and dynamic assemlies. Differences between them

#61607;    Database
-    What are the types of triggers
-    Types of locks in database
-    Types of indexes. What is the default key created when a primary key is created in a table
-    What is clustered, non-clustured and unique index. How many indexes can be created on a table
-    Can we create non-clustured index on a clustered index
-    Types of backups
-    What is INSTEAD OF trigger
-    What is difference between triggers and stored procedures. And advantages of SP over triggers
-    What is DTS and purpose of DTS
-    Write a query to get 2nd maximum salary in an employee table
-     Types of joins.
-    What is currency type in database
-    What are nested triggers
-    What is a heap related to database

#61607;    General

•    HR
-    About yourdelf
-    About procsses followed
-    Notice period
-    Appraisal process
-    What is SOAP and why it is required
-    About effort estimation
-    Whether salary negotiable
-    Why are looking for a change
-    How fo you appraise a person
-    Do you think CMM process takes time
-    About peer reviews
-    How do you communicate with TL / PM / Onsite team
 
#61656;    DELL

•    Technical

#61607;    .NET
-    Any disadvantages in Dataset and in reflection
-    Difference between Active Exe and Activex dll
-    Can we make activex dll also ti execute in some process as that of client ? How can we do?
-    Types of compatabilities and explain them
-    Types of instancing properties and explain each. Tell the difference between multiuse,singleuse and globalmultiuse and which is default
-    What is assembly?
-    Difference between COM and .NET component
-    What is early binding and Late binding. Difference which is better
-    What happens when we instantiate a COM component
-    What happens when we instantiate a .NET component
-    Are you aware of containment and Aggregation
-    What is UUID and GUID what is the size of this ID?
-    About Iunknown interface  Queue ,its methods Querry Interface Addref,Release and Explane each
-    What 'll u do in early and late binding
-    In early binding will the method invoked on com component will verify it's existance in the system or not?
-    Difference between dynamic query and static query
-    About performance issues on retrieving records
-    About ADO and its objects
-    What is unmannaged code and will CLR handle this kind of code or not .
-    Garbage collector's functionality on unmanaged code
-    If Instancing  = Single use for ActiveX Exe, how will this be executed if there are 2 consecutive client requests ?
-    Threading Types.
-    How about the security in Activex DLL and Activex EXE

#61607;    Database
-    Types of cursors and explanation each of them
-    Types of cursor locations and explanation on each of them
-    Types of cursor locks and explanation each of them
-    How do you retrieve set of records from database server.{Set max records = 100 & use paging where pager page no or records = 10 & after displaying 100 records again connect to database retrieve next 100 }

•    HR & Project

-    Rate  yourself  in vb and com
-    Whether I have any specific technology in mind to work on.


#61656;    MMTTS

•    Technical

#61607;    .NET
-    About .NET Framework
-    About Assembly in .NET, types of assemblies, their difference, How to register into GAC. How to generate the strong names & its use.
-    What is side by side Execution?
-    What is serialization?
-    Life cycle of ASP.NET page when a request is made.
-    If there is submit button in a from tell us the sequence what happens if submit is clicked and in form action is specified as some other page.
-    About a class access specifiers and method access specifiers.
-    What is overloading and how can this be done.
-    How to you declare connection strings and how to you make use of web.config.
-    How many web.copnfig can exists in a web application & which will be used.
-    About .NET Remoting and types of remoting
-    About Virtual functions and their use.
-    How do you implement Inheritance in dot net
-    About ado.net components/objects. Usage of data adapters and tell the steps to retrieve data.
-    What does CLR do as soon as an assembly is created
-    How do you retrieve information from web.config.
-    How do you declare delegates and are delegates and events one and the same and explain how do you declare delegates and invoke them.
-    If I want to override a method 1 of class A and in class b then how do you declare?
-    What does CLR do after the IL is generated and machine language is generated .Will it look for main method
-    About friend and Protected friend
-    About multi level and multiple inheritance how to achieve in .net
-    Sequence to connect and retrieve data from database useig dataset
-    About sn.exe
-    What was the problem in traditional component why side by side execution is supported in .net
-    How .net assemblies are registred as private and shared assembly
-    All kind of access specifiers for a class and for methods
-    On ODP.net
-    Types of assemblies that can be created in dotnet
-    About namespaces
-    OOPs concept
-    More on CLR

•    HR & Project
-    About yourself
-    About the current employer
-    About expertise
-    What type of job you are expecting
-    What is current and expected is it negotiable
-    Can you justify why r you expecting more in professional terms
-    What are you looking for in Dell

Workflow Enabled Services and Other New Features in the .NET Framework 3.5

Find the Virtual LAB Machine for VS-2008. Its very nice… please go thought the below site when you get time.

 

http://labs.netfx3.com/

 

Textarea Maxlength script

 

 

Step 1: Add the below script to the <HEAD> section of your page:

 

<script type="text/javascript">

 

/***********************************************

* Textarea Maxlength script- © Dynamic Drive ( www.dynamicdrive.com)

* This notice must stay intact for legal use.

* Visit http://www.dynamicdrive.com/ for full source code

***********************************************/

 

function ismaxlength(obj){

var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""

if (obj.getAttribute && obj.value.length>mlength)

obj.value=obj.value.substring(0,mlength)

}

 

</script>

 

Step 2: Inside any textarea you wish to add a "maxlength" attribute to, simply do the following:

<textarea maxlength="40" onkeyup="return ismaxlength(this)" ></textarea>

 

 

JavaScript - TreeView

Find the below code to select the node under the parent.

 

This code has been tested and working very well.

 

Bala, please check is this code works with Ajax, we are calling the SelectTreeNodes javascript function.

 

 

 

 

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile ="Default.aspx.cs" Inherits="_Default" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Import Namespace="System.Collections.Generic " %>

<html xmlns=" http://www.w3.org/1999/xhtml" >

<head runat="server">

    <title >Untitled Page</title >

   

<script language="javascript">

 

function SelectTreeNodes()

{

 

var obj = window. event.srcElement;

var treeNodeFound = false;

var checkedState;

if (obj.tagName == "INPUT" && obj.type == "checkbox") {

var treeNode = obj;

checkedState = treeNode.checked;

do

{

obj = obj.parentElement;

} while (obj.tagName != "TABLE" )

var parentTreeLevel = obj.rows[0].cells.length;

var parentTreeNode = obj.rows[0].cells[0];

var tables = obj.parentElement.getElementsByTagName ("TABLE");

var numTables = tables.length

if (numTables >= 1)

{

for (i=0; i < numTables; i++)

{

if (tables[i] == obj)

{

treeNodeFound = true;

i++;

if (i == numTables)

{

return;

}

}

if (treeNodeFound == true)

{

var childTreeLevel = tables[i].rows[0].cells.length;

if (childTreeLevel > parentTreeLevel)

{

var cell = tables[i].rows[0].cells[childTreeLevel - 1];

var inputs = cell.getElementsByTagName( "INPUT");

inputs[0].checked = checkedState;

}

else

{

return;

}

}

}

}

}

}

 

</script >

 

 

   

</head >

<body >

    <form id="form1" runat ="server">

    <div >

        <asp :TreeView ID="TreeView1" Height="319px" onclick ="SelectTreeNodes()" runat="server"

            ShowCheckBoxes="All" ShowLines="True" Width ="349px">

            <Nodes >

                <asp :TreeNode Text="New Node" Value="New Node">

                    <asp :TreeNode Text="New Node" Value="New Node">

                        <asp :TreeNode Text ="New Node" Value="New Node"></ asp:TreeNode>

                        <asp :TreeNode Text ="New Node" Value="New Node">

                            <asp :TreeNode Text ="New Node" Value="New Node"></ asp:TreeNode>

                        </asp :TreeNode>

                    </asp :TreeNode>

                    <asp :TreeNode Text="New Node" Value="New Node">

                        <asp :TreeNode Text ="New Node" Value="New Node"></ asp:TreeNode>

                    </asp :TreeNode>

                </asp :TreeNode>

                <asp :TreeNode Text="New Node" Value="New Node"></asp :TreeNode>

                <asp :TreeNode Text="New Node" Value="New Node"></asp :TreeNode>

                <asp :TreeNode Text="New Node" Value="New Node"></asp :TreeNode>

            </Nodes >

        </asp :TreeView>

   

    </div >

    </form >

</body >

</html >

 

 

 

JavaScript Samples

Link's for some online books


Find below link's for some online books of Net 2005 books. I am sure it with definitely  helpful to you.
 
1. ASP .net 2.0 CookBooks
 
 
2. Beginning Asp.net 2.0 in Vb 2005
 
 
3. Beginning ASP.NET 2.0 Databases
 
 
4. Pro ASP.NET 2.0 in C# 2005  
 
 
5. Programming C#  (O'really)
 
 
 

Finding Current Week - SQL Server

 
To get no: of weeks with in two given dates
select datediff(week, convert(varchar(6), getdate(), 112) + '26', '2007-06-30') + 1
To get the week of given date
select ((datediff(week, convert(varchar(6), getdate(), 112) + '01', '2007-06-30') + 1)-
 (datediff(week, convert(varchar(6), getdate(), 112) + '26', '2007-06-30') + 1))+1
 
Visit :

unique key


/*********************************************************************************
' Execution of Stored Procedure
' exec dbo.sp_generate_unique_key 2007,100.00
'*********************************************************************************/


ALTER PROCEDURE [dbo].[USP_ARS_Generateuniquekey]
 (
  @code_key   VARCHAR(15),
  @next_unique_key INT OUTPUT
 )
AS
BEGIN
 DECLARE @message  VARCHAR(255),
  @vc_next_unique_key VARCHAR(255),
  @i_errorcode  INTEGER,
  @i_return  INTEGER,
  @s_errorMsg  VARCHAR(255),
  @start_with   INT,
  @max_value   INT,
  @cycle    CHAR(1)

 /*==================================
  * Initialise local variables
  *=================================*/  
 SELECT @i_errorcode  = 0 
 SELECT @i_return  = 0
 SELECT @s_errorMsg = 'sp_generate_unique_key - '

 
  BEGIN TRANSACTION generate_unique_key_inner

 SELECT  @next_unique_key = KEY_SEQUENCE,
  @start_with = ISNULL(START_WITH,1),
  @max_value = ISNULL(MAX_VALUE,999999999),
  @cycle = ISNULL(CYCLE,'Y')
 FROM  TBL_ARS_KEY_SEQUENCE
 WHERE  CODE_KEY = @code_key;

 /*===================================================
  * If sequence number has already been reached its maximum value
  *==================================================*/
 IF (@next_unique_key > @max_value)
 BEGIN
 
  /*===================================================
   * If sequence number does not have cycle propery then raise error
   *==================================================*/
  If @cycle = 'N'
  BEGIN
   SELECT @s_errorMsg = @s_errorMsg + 'Can''t generate Sequence number as it reaches its maximum value'
   SELECT @i_errorcode = -1
   GOTO ExitRoutine
  END
  ELSE
  /*===================================================
   * Otherwise, reset the next sequence number to its starting value
   *==================================================*/
  BEGIN
   UPDATE  TBL_ARS_KEY_SEQUENCE
   SET  KEY_SEQUENCE  = @start_with
   WHERE  CODE_KEY  = @code_key
  END
 END
 
 UPDATE  TBL_ARS_KEY_SEQUENCE
 SET  KEY_SEQUENCE  = key_sequence + 1
 WHERE  CODE_KEY  = @code_key

 SELECT @i_errorcode = @@error
 
 IF (@i_errorcode != 0)
 BEGIN
  GOTO ExitRoutine
 END

 SELECT  @next_unique_key = KEY_SEQUENCE - 1
 FROM  TBL_ARS_KEY_SEQUENCE
 WHERE  CODE_KEY = @code_key

 SELECT @i_errorcode = @@error
 
 IF (@i_errorcode != 0)
 BEGIN
  GOTO ExitRoutine
 END

 COMMIT TRANSACTION generate_unique_key_inner
 
 RETURN 0
 
 /*=============================
 * ExitRoutine
 *============================*/
 ExitRoutine:
 
 BEGIN
  /*=============================
   * Check for Error
   *============================*/
  IF ( @i_errorcode < 0 )
  BEGIN
   RAISERROR 99999 @s_errorMsg
   SELECT @i_return = -100
  END
  ELSE IF ( @i_errorcode > 0 )
  BEGIN
   SELECT @i_return = -100
  END
  
  ROLLBACK TRANSACTION generate_unique_key_inner
  
  /*=============================
   * Exit & Return 
   *============================*/
  RETURN @i_return
 END
END

Custom C# Code Snippets

SQL Server Queries - SQL Server Query Tips and Tricks for Efficient SQL Server Query Performance



Please find below article on how to write a SQL Server Queries…

---------------------------------------------------------------------------------------------------------------------------------------

Efficient and optimized SQL Server queries and stored procedures

---------------------------------------------------------------------------------------------------------------------------------------

Writing efficient and optimized SQL Server queries and stored procedures needs to be known to some degree by most developers even if you are not a database administrator.  I think a good understanding of the basics can get you pretty far as a developer on most projects.  There are plenty of blogs, websites, books and other resources where more specialized developers have graciously offered their expertise to help you during those times when it is better to know WHERE to find the answer as opposed to KNOWING the answer.

25 SQL Commandments

An article, called 25 SQL Commandments, is a list of tips to help a developer avoid the plague of poorly written SQL statements.  The article itself is written for Oracle with some specific Oracle commandments, but a lot of the commandments hold true for SQL Server, too.  The 25 SQL Commandments briefly are:

  • Know your data and business application well.
  • Test your queries with realistic data.
  • Write identical SQL statements in your applications.
  • Use indexes on the tables carefully.
  • Make an indexed path available.
  • Use Explain Plan and TKPROF where possible.
  • Think globally when acting locally.
  • The WHERE clause is crucial.
  • Use WHERE instead of HAVING for record filtering.
  • Specify the leading index columns in WHERE clauses.
  • Evaluate index scan vs. full table scan.
  • Use ORDER BY for index scan.
  • Know thy data.
  • Know when to use large-table scans.
  • Minimize table passes.
  • Join tables in the proper order.
  • Use index-only searches when possible.
  • Redundancy is good.
  • Keep it simple, stupid.
  • You can reach the same destination in different ways.
  • Use the special columns.
  • Use explicit cursors over implicit cursors.
  • Explore and take advantage of the Oracle parallel query option.
  • Reduce network traffic and increase throughput.

 

 

 

 

New Language - F#

find the below link for another language created by software giant Microsoft.

 

http://research.microsoft.com/fsharp/fsharp.aspx

 

MSDN and DDJ magazines online

Did you know that you can subscribe to the digital editions of MSDN Magazine and Dr. Dobbs Journal for FREE?

Go to http://msdn2.microsoft.com/hi-in/bb736747.aspx to see samples of the digital magazine.

Please click on https://profile.microsoft.com/RegSysProfileCenter/wizard.aspx?wizid=f4cc7a02-9146-41d9-acf3-d816d4f34f0c&lcid=16393 to subscribe to MSDN Magazine and Dr. Dobbs Journal Digital editions.

Take (Keyboard) Shortcuts - Visual Studio 2005

Take (Keyboard) Shortcuts for VS-2005/2003.

Using keyboard shortcuts is the best way to get things done faster in Visual Studio (and most other computer applications for that matter).

Below are my favorite Visual Studio keyboard shortcuts (I am leaving out the really obvious ones like F5).

  • CTRL+ALT+L: View Solution Explorer. I use Auto Hide for all of my tool windows to maximize screen real estate. Whenever I need to open the Solution Explorer, it's just a shortcut away. Related shortcuts: CTRL+ALT+X (Toolbox), F4 (Properties), CTRL+ALT+O (Output), CTRL+\, E (Error List), CTRL+\, T (Task List).
  • F12: Go to definition of a variable, object, or function.
  • SHIFT+F12: Find all references of a function or variable.
  • F7: Toggle between Designer and Source views.
  • CTRL+PgDn: Toggle between Design and Source View in HTML editor.
  • F10: Debug - step over. Related debugging shortcuts: F5 (debug - start), F11 (debug - step into), SHIFT-F11 (debug - step out), CTRL-F10 (debug - run to cursor). F9 (toggle breakpoint).
  • CTRL+D or CTRL+/: Find combo (see section on Find Combo below).
  • CTRL+M, O: Collapse to Definitions. This is usually the first thing I do when opening up a new class.
  • CTRL+K, CTRL+C: Comment block. CTRL+K, CTRL-U (uncomment selected block).
  • CTRL+-: Go back to the previous location in the navigation history.
  • ALT+B, B: Build Solution. Related shortcuts: ALT+B, U (build selected Project), ALT+B, R (rebuild Solution).
  • CTRL+ALT+Down Arrow: Show dropdown of currently open files. Type the first few letters of the file you want to select.
  • CTRL+K, CTRL+D: Format code.
  • CTRL+L: Delete entire line.
  • CTRL+G: Go to line number. This is useful when you are looking at an exception stack trace and want to go to the offending line number.
  • SHIFT+ALT+Enter: Toggle full screen mode. This is especially useful if you have a small monitor. Since I upgraded to dual 17″ monitors, I no longer needed to use full screen mode.
  • CTRL+K, X: Insert "surrounds with" code snippet. See Snippets tip below.
  • CTRL+B, T: Toggle bookmark. Related: CTRL+B , N (next bookmark), CTRL+B, P (prev bookmark).

The complete list of default shortcuts is available from VS 2005 Documentation. You can also download/print reference posters from Microsoft: C# Keyboard Reference Poster , VB.NET Keyboard Reference Poster .

Good Tips on Google

SEARCH eBOOK in FTP SEARCH ENGINE

 

To find eBook in FTP Search, visit one of this website

 

http://search.ftphost.net/

http://www.filesearching.com/

http://reliz.ru/

http://www.narlytime.com/

http://amun.serveftp.com/

http://ftpsearch.tomsk.net/

 

e.g. if you want to search " Sams Teach Yourself " just type Teach Yourself, you will have some eBooks in some FTP servers.

also can be found with specific format (e.g. PDF & CHM)

 

 

As you know Google.com is the most popular search engine in the world.

 

Here are some tips to helps you find eBooks with Google:

 

Find Apache's (default) Index page

 

Try this query:

 

+("index of") +("/ebooks"|"/book") +(chm|pdf|zip|rar) +apache

 

Find a particular eBook file

 

Try this query:

allinurl: +(rar|chm|zip|pdf|tgz) TheTitle 

 

Thanks

Satish