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 string qry = string.Empty;
public SqlDataAdapter dap = null;
public DataSet dst = null;
public string proj;
public string mod;

protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString =
ConfigurationManager.ConnectionStrings
["Connection"].ToString();
con.Open();

string sql = string.Empty;
string projCode = string.Empty;
string moduleID = string.Empty;

if (!IsPostBack)
{
qry = "Select Projcode from Etmtech.dbo.Project
where edgesupported = 1 and libraryname = 'recon' order by
projcode";
dap = new SqlDataAdapter(qry, con);
dst = new DataSet();
dap.Fill(dst);

selProject.DataSource = dst;
selProject.DataTextField = dst.Tables[0].Columns
["Projcode"].ToString().ToUpper();
selProject.DataBind();

dap.Dispose();
dst.Dispose();

qry = "Select clientname,clientid from
etmtech.dbo.client (nolock) order by clientid";
dap = new SqlDataAdapter(qry, con);
dst = new DataSet();
dap.Fill(dst);

selClient.DataSource = dst;
selClient.DataTextField = dst.Tables[0].Columns
["clientname"].ToString();
selClient.DataValueField = dst.Tables[0].Columns
["clientid"].ToString();
selClient.DataBind();

dap.Dispose();
dst.Dispose();

}

projCode = selProject.SelectedValue.ToString();

if(Session["projCode"] == null || !projCode.Equals
(Session["projCode"].ToString()))
{
qry = string.Empty;
qry = "Select descr,moduleid from
Recon.dbo.Recon_Menu (Nolock) where projcode = '" +
selProject.SelectedItem.Text + "'";
dap = new SqlDataAdapter(qry, con);
dst = new DataSet();
dap.Fill(dst);

selModule.DataSource = dst;
selModule.DataValueField = dst.Tables[0].Columns
["moduleid"].ToString();
selModule.DataTextField = dst.Tables[0].Columns
["descr"].ToString();
selModule.DataBind();

dap.Dispose();
dst.Dispose();

Session["projCode"] = projCode;
}

moduleID = selModule.SelectedValue;

if (!moduleID.Equals(string.Empty))
{
qry = string.Empty;
qry = "select
o.objectorder,o.descr,pt.name,p.parmvalue from
recon.dbo.recon_object o (nolock)";
qry = qry + " ,recon.dbo.recon_parameter p
(nolock),recon.dbo.recon_lu_parametertype pt (nolock)";
qry = qry + " where o.moduleid =" +
Convert.ToInt32(moduleID) + " and o.objectid = p.objectid
and p.parmtypeid = pt.parmtypeid order by o.objectorder";
dap = new SqlDataAdapter(qry, con);
dst = new DataSet();
dap.Fill(dst);

GVobj.DataSource = dst;
GVobj.DataBind();

if (dst.Tables[0].Rows.Count > 0)
{
btSave.Enabled = true;
btCancel.Enabled = true;
}

dap.Dispose();
dst.Dispose();

}

string client = selClient.SelectedValue.ToString();

}

protected void GVobj_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowIndex == 0)
{
proj = e.Row.Cells[1].Text;
}

if (e.Row.RowIndex > 0)
{
if (proj.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

What is the use of web.config and machine.config files?

1125


Explain server control extensibility with reference to asp.net 2.0 ?

975


Define repository pattern in mvc.net? : asp.net mvc

1027


What is the behavior of a Web browser when it receives an invalid element?

1094


What is Razor View Engine

1057


When was asp.net released?

1009


i want to implement grid view value in paypal site. so how to create this code in asp.net with C#

1909


In a webservice, need to display 10 rows from a table. Which is the best choice among datareader or dataset?

1166


Define globalization and localization.

965


What is meant by ispostback in asp net?

1042


3. What goals do you have in your career?

1843


What is the question mark in a url?

943


What is owin authentication?

946


What is gridview in asp.net?

968


What’s the difference between asp.net web forms and asp.net mvc?

1143