| TechTasks.net |
The Blog is Moved to www.TechTasks.net
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
using System;
using System.Data;
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.SqlClient;
using System.Drawing;
public partial class _Default : System.Web.UI.Page
{
SqlConnection con; DataSet ds; SqlDataAdapter da;
protected void Page_Load(object sender, EventArgs e)
{
con = new SqlConnection("Data Source=TECH-DA98E1DFBA\\SQLEXPRESS;Initial Catalog=tempdb;Integrated Security=True");
con.Open();
da = new SqlDataAdapter("select * from emp", con);
ds = new DataSet();
da.Fill(ds, "emp");
GridView1.DataSource = ds;
GridView1.DataBind();
}
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.DataItem != null)
{
DataRowView drv = (DataRowView)e.Row.DataItem;
int sal = int.Parse(drv["sal"].ToString());
if (sal >= 10000)
e.Row.BackColor = Color.LightBlue ;
//Display gridveiw row in diff color whose sal is greaterthan 10,000
}
}
}
}
Blog Archive
-
▼
2008
(33)
-
►
December
(14)
- Non Editable Rows in GridView
- Validate DropDownList inside GRIDVIEW
- .Net Keyboard Shortcuts
- Grid View Operataions
- FAQ'S & INTERVIEW TIPS
- C#.NET
- ASP.NET
- DOTNET FRAMEWORK
- Projects With Source Code
- Enter Text In Into Two TextBoxes At the Same Time
- Saving Uploaded file into Disk and displaying the ...
- Writing Connection string in web.config file
- Change GridView Row Color When MouseOver
- Working With Command Builder in ASP.NET
-
►
November
(14)
- JavaScript Validatoin For Basic Controles in ASP.N...
- Dot Net - C#.Net(FAQ'S)
- Dot Net - Asp.Net - Basic II(FAQ'S)
- Dot Net - Asp.Net - Basic I(FAQ'S)
- Famous Books For .NET
- Connecting MySql With Asp.net Using ODBC Drivers
- Simple Calculator In Windows Application Using C#
- Mail Sending Using Net.Mail
- Select All And Delete Using CheckBox In GridView
- GridView DeleteAll,SelectAll,ClearAll(Server Side)...
- GridView Paging & Sorting
- GridView Update,Delete,Adding (Insert) Record...
- Alphabetical Paging in Gridview
- Connecting MySql With C# ASP.NET
-
►
December
(14)


2 comments:
It was extremely interesting for me to read that post. Thanx for it. I like such topics and anything that is connected to them. I definitely want to read more on that blog soon.
Don't stop posting such stories. I like to read articles like that. Just add more pics :)