📄 grid.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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 grid : System.Web.UI.Page
{
//static string qwe;
static string locality;
static string price;
static string area;
static string facing;
static string bedroom;
static string floorno;
static string tab;
protected void Page_Load(object sender, EventArgs e)
{
//qwe = Session["z"].ToString();
/* if (tab == "residentialland")
{
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=epropertydb;Integrated Security=True");
con.Open();
SqlDataAdapter da = new SqlDataAdapter("Select * from residentialland", con);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
GridView2.DataSource = ds;
GridView2.DataBind();
}
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=epropertydb;Integrated Security=True");
con.Open();
SqlDataAdapter da = new SqlDataAdapter("Select facing,shortdescription,annualdues,electricalsupply,railwaydistance,schooldistance,busstopdistance,hospitaldistance from (residentialland join propertyforsalerent ON residentialland.propertyid=propertyforsalerent.propertyid) where(locality='punjabi bagh' AND facing='" + qwe + "' )", con);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
GridView2.DataSource = ds;
GridView2.DataBind();*/
locality = Session["l"].ToString();
price = Session["p"].ToString();
area = Session["ar"].ToString();
facing = Session["fc"].ToString();
bedroom = Session["bd"].ToString();
floorno = Session["fl"].ToString();
tab = Session["ap"].ToString();
if (tab == "Residential Land")
{
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=epropertydb;Integrated Security=True");
con.Open();
SqlDataAdapter da = new SqlDataAdapter("Select facing,shortdescription,annualdues,electricalsupply,railwaydistance,schooldistance,busstopdistance,hospitaldistance from (residentialland join propertyforsalerent ON residentialland.propertyid=propertyforsalerent.propertyid) where(locality='" + locality + "' AND pricerent='" + price + "' AND area='" + area + "' AND facing='" + facing + "' )", con);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
GridView2.DataSource = ds;
GridView2.DataBind();
}
}
/* protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=epropertydb;Integrated Security=True");
con.Open();
SqlDataAdapter da = new SqlDataAdapter("Select locality,area,price from propertyforsalerent where city='"+TextBox1.Text.Trim()+"'", con);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
GridView1.DataSource = ds;
GridView1.DataBind();
}*/
protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -