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 »

31/08/2012 by Nitesh

Combine several images to form a single image using C#

Friends, Today, I was working on a problem where I required to add up two image to form a single image. The following code does the same for you. 1. Place a button from the toolbar on your C# form. 2. Select the button and press F4. 3. Change the name to cmdCombine and text…

Continue Reading »

22/08/2012 by Nitesh

How to add a piece of Javascript just before the end of Form Tag in ASP.Net

In ASP.Net, we often require to add some piece of Javascript from Code-behind that should get added towards the end of <form> tag and not in the header of the form. For this, we need to use RegisterStartupScript function. The syntax to use the function is as below: Page.RegisterStartupScript(this.GetType(),”key_for_script”, “alert(‘Hey! This gets alerted after the…

Continue Reading »

11/05/2012 by Nitesh

How to Optimize and Repair MySQL tables

Very Often when we deal with large amount of data in MySQl table, we need to Optimize and repair MySQL tables. Here are the MySQL Queries to do the same: Optimize Table: OPTIMIZE TABLE TBL_NAME Repair Table: REPAIR TABLE TBL_NAME The Other way of doing this is to follow the below steps. Go to PhpMyAdmin…

Continue Reading »

09/05/2012 by Nitesh

How to Change Startup Form in VB .Net Windows Application

Today, I was working on a demo VB.Net windows application and going the Visual studio way, I added a new Windows Form Application in VB.Net. It created a default Form1.vb form with start up items. I added a new form MainForm.vb and then I wanted to change the application start up form to MainForm.vb from…

Continue Reading »

1 5 6 7 8