29/11/2012 by Nitesh

How to Execute a Query Stored in a variable in Stored Procedure

Friends, Today, I was working with SQL Server and found an interesting situation where I wanted to store my query in a variable in stored procedure and after preparing the query based on parameters, execute the query at the last. I came up with an interesting solution for this. Let us consider the below stored…

Continue Reading »

27/11/2012 by Nitesh

How to transform text from one case to another using javascript

Friends, This post will describe converting text from one case to another using javascript. In general programming, we need to convert a text to the following cases – Lower Case Upper Case Title Case We will see the conversion one by one below – To convert a text into lowercase using Javascript function toLowerCase(str) {…

Continue Reading »

02/11/2012 by Nitesh

How to send Email using Gmail Server

I have seen many developers asking this questions and hence thought of writing this brief post. This post describes the code to send an email in C# using Gmail as mail server. SmtpClient smtpServer = new SmtpClient(“smtp.gmail.com”); smtpServer.Port = 587; smtpServer.Host=”smtp.gmail.com”; smtpServer.Credentials = new NetworkCredential(“username@gmail.com”, “PASSWORD”); smtpServer.EnableSsl = true; MailMessage mail = new MailMessage(); mail.From…

Continue Reading »

26/10/2012 by Nitesh

AutoComplete Textbox in Windows Form

Friends, We use AutoComplete feature in our websites many times. Wonder, how we can achieve the same in windows forms. Let us build it today. We will do it step by step as mentioned below- Open Visual Studio and create a new Windows Form Application Project and name it “AutoCompleter” Drag and Add a TextBox…

Continue Reading »

12/09/2012 by Nitesh

How to Select a random row with Microsoft SQL Server

A quick post for all – We often find situations where we need to retrieve random records from a MS SQL table. The below query does the same for you. To generate a random record from a table in Microsoft SQL Server, we need to execute the following query: SELECT TOP 1 * FROM tbl_name…

Continue Reading »

1 2 3 4 5 6