Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between Server.Transfer and
Response.Redirect? Why would you choose one over the other?

Answer Posted / x

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;
public partial class _Default : System.Web.UI.Page
{
public SqlDataAdapter dap = null;
public DataSet dst = null;
public string projDesc = string.Empty;
public string divisionName = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString =
ConfigurationManager.ConnectionStrings["conString"].ToString
();
con.Open();
string sql = string.Empty;
string projCode = string.Empty;
string divisionCode = string.Empty;

if (!IsPostBack)
{
dap = new SqlDataAdapter("select * from
Project", con);
dst = new DataSet();
dap.Fill(dst);
ddlProject.DataSource = dst;
ddlProject.DataValueField = dst.Tables
[0].Columns["ProjCode"].ToString();
ddlProject.DataTextField = dst.Tables[0].Columns
["ProjDesc"].ToString();
ddlProject.DataBind();
dap.Dispose();
dst.Dispose();
}
projCode = ddlProject.SelectedValue.ToString();
if (Session["projCode"] == null || !projCode.Equals
(Session["projCode"].ToString()))
{
sql = "select * from Division where ProjCode
= " + Convert.ToInt32(projCode);
dap = new SqlDataAdapter(sql, con);
dst = new DataSet();
dap.Fill(dst);
ddlDivision.DataSource = dst;
ddlDivision.DataValueField = dst.Tables
[0].Columns["DivisionID"].ToString();
ddlDivision.DataTextField = dst.Tables
[0].Columns["DivisionName"].ToString();
ddlDivision.DataBind();
dap.Dispose();
dst.Dispose();
Session["projCode"] = projCode;
}
divisionCode = ddlDivision.SelectedValue.ToString();
if (!divisionCode.Equals(string.Empty))
{
sql = "select a.ProjDesc, b.DivisionName,
c.MemberName from Project a inner join Division b on
a.ProjCode = b.ProjCode ";
sql += "inner join Member c on b.DivisionID =
c.DivisionID where a.ProjCode = " + Convert.ToInt32
(projCode);
sql += " and b.DivisionID = " + Convert.ToInt32
(divisionCode);
dap = new SqlDataAdapter(sql, con);
dst = new DataSet();
dap.Fill(dst);
gvProj.DataSource = dst;
gvProj.DataBind();
dap.Dispose();
dst.Dispose();
}
con.Close();
}

protected void gvProj_RowDataBound(object sender,
GridViewRowEventArgs e)
{
gvRowCheck(e);
}
private void gvRowCheck(GridViewRowEventArgs e)
{
if (e.Row.RowIndex == 0)
{
projDesc = e.Row.Cells[0].Text;
divisionName = e.Row.Cells[1].Text;
}
if (e.Row.RowIndex > 0)
{
if (projDesc.Equals(e.Row.Cells[0].Text))
{
e.Row.Cells[0].Text = "";
}
if (divisionName.Equals(e.Row.Cells[1].Text))
{
e.Row.Cells[1].Text = "";
}
}
}

}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does session authentication work?

908


What is the difference between a cookie and a pixel?

914


Explain a program using razor view engine to create a simple application? : asp.net mvc

996


If you want to bind the columns manually within the asp:datagrid tags what kind of tags you have to add.

1040


Is asp.net a programming language?

988


Which property is used to identify the Page is Post Back in ASP.NET?

1004


What is an asp.net web form?

1071


Where would you use an ihttpmodule, and what are the limitations if any?

998


What is marshalling ? Is it a part of asp.net ?

1081


What do you understand from custom control?

1099


What do you mean by serialize and marshalbyref?

1001


What is the difference between ldap and active directory?

1059


Why mvc is better than asp.net? : Asp.Net MVC

930


What is the use of express session?

958


Which method is used to perform all validation at the page level?

953