SqlConnection con = new SqlConnection(str); string strQ = ("select s.Property_ID,s.Property_For,s.Property_Type,s.Property_Name,C.City_Name,L.Locality_Name,s.Price,s.Bedroom,s.Area,s.ImageName,s.ImagePath From tbl_Post_Property as s inner join tbl_City as C on C.City_Id=s.City_id inner join tbl_Locality as L on L.Locality_Id=s.Locality_Id where Property_For='"+ rbtnsearch.SelectedItem.Text +"' and s.Property_type='" + ddlpropertytype.SelectedItem.Text + "' and C.City_Id=" + ddlcity.SelectedValue + " and L.Locality_Id=" + ddllocality.SelectedValue + " and s.price between " + ddlminprice.SelectedValue + " and " + ddlmaxprice.SelectedValue + ""); con.Open(); SqlDataAdapter da = new SqlDataAdapter(strQ, con); DataTable dt = new DataTable(); da.Fill(dt); Session["Search"] = dt; con.Close(); Response.Redirect("SearchResult.aspx", false);
DataTable dt = new DataTable(); dt = Session["Search"] as DataTable; listview1.DataSource = dt; listview1.DataBind();
int rowcount = dt.rows.count();
Label1.Text = Covert.ToString(dt.Rows.Count)+"Records found ";
if(dt.Rows.Count > 0) { lblSearchResultText.Text = Covert.ToString(dt.Rows.Count) + " Records found."; } else { lblSearchResultText.Text = "No records found."; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)