grid.aspx.cs

来自「its a website on property dealing made i」· CS 代码 · 共 94 行

CS
94
字号
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 + =
减小字号Ctrl + -
显示快捷键?