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:

http://aspdotnetcodebook.blogspot.com/
http://www.dotnetcurry.com/ShowArticle.aspx?ID=92

“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 http://www.orkut.com 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.

http://my.opera.com/krishnan/blog/index.dml/tag/orkut%20worm

Bye

Display Empty Gridview with a Message

4 Comments


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.

<EmptyDataTemplate>

No Data Available

</EmptyDataTemplate>

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: http://dev.mysql.com/downloads/gui-tools/5.0.html
3) Download the connector for .NET 2.0 at: http://dev.mysql.com/downloads/connector/net/5.0.html
4)Download the Mysql ODBC driver at: http://dev.mysql.com/downloads/connector/odbc/3.51.html

All these links will be seen by you if you observe carefully at http://dev.mysql.com/downloads/

First read the article at:

http://www.15seconds.com/issue/050210.htm

Here the installation is given with screen shots

http://www.15seconds.com/issue/050210.htm

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

While creating a website in ASP.net 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 asp.net

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();
da.Fill(ds);

GridView1.DataSource = ds;
GridView1.DataBind();

}
}

%d bloggers like this: