Programming
Row Number function in SQL Server
Submitted by vaibhav on Fri, 06/18/2010 - 16:31I used to create temporary tables and subqueries to add a row number to every row in the result set. But somedays ago, I came across to the Row_Number() function provided in Sql Server, which simply constructs the row number column on the fly as part of the query. But a question might have arosed in your mind, What is the use of adding a Row_Number, when we have serial number associated with every row. There are several situation, where we need to query against the row number.(we can't query against a serial number)
Syntax Highlighting using GeSHi Filter and FCKeditor in Drupal
Submitted by vaibhav on Tue, 02/23/2010 - 14:54When I was developing this site, I knew I would be publishing a lot of Source Code. After some googling I foung GeSHi Filter for Source Code Syntax Highlighting. This module integrates the third party PHP library GeSHi (Generic Syntax Highlighter) into Drupal. GeSHi Filter, syntax highlight your source code between <blockcode>tag.
Index in Sql Server
Submitted by shantanu on Wed, 01/06/2010 - 04:29Understanding Indexes
Indexes speed up the querying process by providing filtered access to rows in the data tables (just like book’s index) if they are used efficiently.
Indexes are created on columns in tables or views.
How to create a session variable in ASP.NET
Submitted by shantanu on Sat, 12/19/2009 - 13:38- Define an ASP.NET web site.
- Create two pages within the site. The first page will contain an ASP.NET Web Form that will post back to itself and then redirect to the second page.
Note: The reason this example uses two pages is to prove that a session variable is available to a second, third, fourth, etc. page in the web site. Request variables, which are an alternative to session variables, cannot be carried over from an ASP.NET Web Form on one page to a second page
SQL Server 2005 error 10061
Submitted by vaibhav on Mon, 11/30/2009 - 15:31I needed to connect to sql server from a remote computer which is on my home lan.
But got this error message.
SQL Server: Backup and Restore Database using T-SQL
Submitted by vaibhav on Wed, 11/11/2009 - 12:18Its very easy to take Backup and Restore your Database using T-SQL even if you are not a DBA. In one of the client application, I wanted to take periodic Backup without logging in to SQL Server Management Studio. Here in this small tutorial I will try to elaborate the procedure of taking database backup using T-SQL.
1. Create a Database
CREATE DATABASE PracticeDB
2. Take Backup of the Database
BACKUP DATABASE PracticeDB TO DISK='C:\PracticeD.bak' WITH DESCRIPTION='Database Backup', INIT, PASSWORD='TryAgain'
Regular Expression to Check Password Strength
Submitted by vaibhav on Mon, 11/02/2009 - 01:57Last few days I was trying hard to come up with a Regular Expression for checking password strength in JavaScript. For those who don't know what is a regular expression and How it can be used, Here is a wonderful link for you. Regular Expression can be a very handy code, for Matching two strings, Data Validation and even Syntax Highlighting.
"Error: 26 – Error Locating Server/Instance" Specified SQL Server
Submitted by shantanu on Tue, 10/27/2009 - 15:13“An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connection. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)”
This error might have occured due to the following reasons.
How to do Numeric Validation in Drupal Webforms
Submitted by vaibhav on Sat, 10/10/2009 - 11:13I spent a lot of time to figure out How to restrict only numeric data in drupal webforms. To my surprise drupal does'nt provide such functionality. But we can achieve it through Additional Validation in Webform Advanced Settings.
Just write this PHP code in additional validation.
$mobile_no = $form_values['submitted_tree']['mobile_no']; if (strlen(trim($mobile_no)) > 0){ if (!is_numeric($mobile_no)) { form_set_error('submitted][mobile_no', t('Mobile No. must be Numeric')); } }
"FormatException was unhandled" Input string was not in a correct format.
Submitted by vaibhav on Wed, 09/23/2009 - 00:11Hi !
Here I am trying to write a function that returns me value based on the following condition...
IF
Variable is NULL return me DBNull.Value
ELSE
Convert Variable into DataType whose DataTypeCode has been provided to me as a parameter of function.
Now while converting a variable into required DataType an exception is thrown "FormatException was unhandled". Input string was not in a correct format.
How do I resolve this error please help.
Here is my code...