Printing in ASP.NET 2.0

Leave a comment

Some time we will get a requirement to print the data in gridview.
Please Follow the links to find the solution:


“I DNT HATE MOZILLA BUT USE IE OR ELSE…”, “USE INTERNET EXPLORER U DOPE”, The administrators didnt write this program guess, “Orkut is banned you fool …

Leave a comment

Some time when we are accessing it will display message like this.

It is a virus.

Follow the below link where you will find the solution given by Krishnan.Thanks for krishnan.


Display Empty Gridview with a Message


If there is No Data in Gridview and we want to show a message that “No data available”.
We can do this by using the following tag in gridview.


No Data Available


Use MySql database with ASP.NET 2.0

Leave a comment

We need 4 things to do this:

1) Download Mysql database at:
2) Download the GUI for Mysql at:
3) Download the connector for .NET 2.0 at:
4)Download the Mysql ODBC driver at:

All these links will be seen by you if you observe carefully at

First read the article at:

Here the installation is given with screen shots

Locate the MySql.Data.dll at:
C:\Program Files\MySQL\MySQL Connector Net\Binaries\.NET 2.0\
in your system.

While creating a website in Create a ASP.NET folder BIN which will be available in 2.0.
After creating the BIN folder place the MySql.Data.dll in BIN Folder.

After installing all the 4.

Just write a small program in

In code behind file

using System;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data;
using MySql.Data.MySqlClient;

public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)

MySqlConnection conn = new MySqlConnection

(“server=localhost; user id=root; password=mysqladmin; database=test; pooling=false;”);
string query = “Select * from stud”;
MySqlDataAdapter da = new MySqlDataAdapter(query, conn);

DataSet ds = new DataSet();

GridView1.DataSource = ds;


%d bloggers like this: