<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true" CodeBehind="searchpayment.aspx.cs" Inherits="property1.WebForm13" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<%--<div style="height:125px"></div>--%>
<table >
<tr>
<td>
<asp:Label ID="Label6" runat="server" Text="Client Name" Font-Bold="True">
</asp:Label>
<asp:DropDownList ID="DropDownList1" CssClass="text1" runat="server" AutoPostBack="True"
onselectedindexchanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>
</td>
</tr>
<tr>
<td colspan="5" align="center" valign="bottom">
<br />
<asp:Panel ID="rr" runat="server" Height="600px">
<asp:GridView ID="GridView1" CssClass="grid-view" AutoGenerateColumns="False" DataKeyNames="id"
runat="server" EnablePersistedSelection="True"
AllowPaging="false"
onpageindexchanging="GridView1_PageIndexChanging"
CaptionAlign="Top" onrowcommand="GridView1_RowCommand"
onrowdatabound="GridView1_RowDataBound" >
<Columns>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center">
<ItemStyle Width="120px" HorizontalAlign="Center" />
<HeaderTemplate>
<asp:Label ID="Label3" runat="server" Width="90px" Text="Select"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton7" CommandName="select" CommandArgument='<%#Eval("id")%>' runat="server" Text="select" Font-Underline="False" Font-Bold="True">Select</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center">
<ItemStyle Width="120px" HorizontalAlign="Center" />
<HeaderTemplate>
<asp:Label ID="Label3" runat="server" Width="30px" Text="Id"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton6" CommandName="show" CommandArgument='<%#Eval("id")%>' runat="server" Text='<%#Eval("id")%>' Font-Underline="False" Font-Bold="True"><%#Eval("id")%></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center"><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label4" runat="server" Width="180px" Text="Name"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("cname")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label5" runat="server" Width="100px" Text="Mobile No."></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("mobile")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label7" runat="server" Width="180px" Text="Address"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("address")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center"><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label4" runat="server" Width="150px" Text="Staff"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("pstaff")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center"><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label4" runat="server" Width="150px" Text="Colony Name"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("colonyname")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center"><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label4" runat="server" Width="100px" Text="Plot No."></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("plotno")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center"><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label4" runat="server" Width="60px" Text="Sector"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("sector")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label127" runat="server" Width="90px" Text="Floor"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("floor")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label117" runat="server" Width="90px" Text="Property Type"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("propertytype")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label97" runat="server" Width="90px" Text="Size"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("size")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label87" runat="server" Width="90px" Text="Estimate Size"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("esize")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label77" runat="server" Width="90px" Text="Date"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#String.Format("{0:dd-MM-yyyy}", Eval("ndate"))%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label67" runat="server" Width="100px" Text="Sale Deed Value"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("saledeedvalue")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label57" runat="server" Width="100px" Text="Stamp"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("stamp")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label47" runat="server" Width="100px" Text="Registration Amount"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("ramount")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label37" runat="server" Width="100px" Text="Expenses"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("expenses")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label17" runat="server" Width="100px" Text="Upexpenses"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("upexpenses")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label27" runat="server" Width="100px" Text="Total"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%#Eval("total")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label8" runat="server" Width="100px" Text="Notification Date"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#String.Format("{0:dd-MM-yyyy}", Eval("ndate"))%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label147" runat="server" Width="180px" Text="Notification Remarks"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("nremarks")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label147" runat="server" Width="180px" Text="total"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("alltotal")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</asp:Panel>
</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<%--<div style="height:125px"></div>--%>
<table >
<tr>
<td>
<asp:Label ID="Label6" runat="server" Text="Client Name" Font-Bold="True">
</asp:Label>
<asp:DropDownList ID="DropDownList1" CssClass="text1" runat="server" AutoPostBack="True"
onselectedindexchanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>
</td>
</tr>
<tr>
<td colspan="5" align="center" valign="bottom">
<br />
<asp:Panel ID="rr" runat="server" Height="600px">
<asp:GridView ID="GridView1" CssClass="grid-view" AutoGenerateColumns="False" DataKeyNames="id"
runat="server" EnablePersistedSelection="True"
AllowPaging="false"
onpageindexchanging="GridView1_PageIndexChanging"
CaptionAlign="Top" onrowcommand="GridView1_RowCommand"
onrowdatabound="GridView1_RowDataBound" >
<Columns>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center">
<ItemStyle Width="120px" HorizontalAlign="Center" />
<HeaderTemplate>
<asp:Label ID="Label3" runat="server" Width="90px" Text="Select"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton7" CommandName="select" CommandArgument='<%#Eval("id")%>' runat="server" Text="select" Font-Underline="False" Font-Bold="True">Select</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center">
<ItemStyle Width="120px" HorizontalAlign="Center" />
<HeaderTemplate>
<asp:Label ID="Label3" runat="server" Width="30px" Text="Id"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton6" CommandName="show" CommandArgument='<%#Eval("id")%>' runat="server" Text='<%#Eval("id")%>' Font-Underline="False" Font-Bold="True"><%#Eval("id")%></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center"><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label4" runat="server" Width="180px" Text="Name"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("cname")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label5" runat="server" Width="100px" Text="Mobile No."></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("mobile")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label7" runat="server" Width="180px" Text="Address"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("address")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center"><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label4" runat="server" Width="150px" Text="Staff"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("pstaff")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center"><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label4" runat="server" Width="150px" Text="Colony Name"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("colonyname")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center"><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label4" runat="server" Width="100px" Text="Plot No."></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("plotno")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center"><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label4" runat="server" Width="60px" Text="Sector"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("sector")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label127" runat="server" Width="90px" Text="Floor"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("floor")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label117" runat="server" Width="90px" Text="Property Type"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("propertytype")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label97" runat="server" Width="90px" Text="Size"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("size")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label87" runat="server" Width="90px" Text="Estimate Size"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("esize")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label77" runat="server" Width="90px" Text="Date"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#String.Format("{0:dd-MM-yyyy}", Eval("ndate"))%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label67" runat="server" Width="100px" Text="Sale Deed Value"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("saledeedvalue")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label57" runat="server" Width="100px" Text="Stamp"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("stamp")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label47" runat="server" Width="100px" Text="Registration Amount"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("ramount")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label37" runat="server" Width="100px" Text="Expenses"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("expenses")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label17" runat="server" Width="100px" Text="Upexpenses"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("upexpenses")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label27" runat="server" Width="100px" Text="Total"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%#Eval("total")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label8" runat="server" Width="100px" Text="Notification Date"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#String.Format("{0:dd-MM-yyyy}", Eval("ndate"))%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label147" runat="server" Width="180px" Text="Notification Remarks"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<%#Eval("nremarks")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ><ItemStyle Width="120px" />
<HeaderTemplate>
<asp:Label ID="Label147" runat="server" Width="180px" Text="total"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("alltotal")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</asp:Panel>
</td>
</tr>
</table>
</asp:Content>
Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.IO;
namespace property1
{
public partial class WebForm13 : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["con"].ToString());
SqlDataAdapter da,da1;
DataTable dt,dt1;
SqlCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
try
{
string username = Session["username"].ToString();
string role = Session["role"].ToString();
if (username != null && role != null)
{
showgrid();
colonyname();
}
else
{
Response.Redirect("login.aspx", false);
Context.ApplicationInstance.CompleteRequest();
}
}
catch (Exception)
{
Response.Redirect("login.aspx");
}
}
}
public void colonyname()
{
da = new SqlDataAdapter("select distinct(cname) from customer", con);
DataTable dt = new DataTable();
da.Fill(dt);
DropDownList1.DataSource = dt;
DropDownList1.DataTextField = "cname";
DropDownList1.DataValueField = "cname";
DropDownList1.DataBind();
DropDownList1.Items.Insert(0, "Select");
}
public void showgrid()
{
try
{
da = new SqlDataAdapter("select c.id,c.cname,c.mobile,c.address,c.pstaff,c.pdate,c.colonyname,c.plotno,c.sector,c.floor,c.propertytype,c.size,c.esize,c.pdate,c.saledeedvalue,c.stamp,c.ramount,c.expenses,c.upexpenses,c.total,c.ndate,c.nremarks,d.total as alltotal from customer c join customer1 d on c.colonyname=d.colonyname and c.floor=d.floor and c.sector=d.sector and c.plotno=d.plotno and c.cname=d.cname ", con);
dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
catch (Exception)
{
con.Close();
}
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
try
{
GridView1.PageIndex = e.NewPageIndex;
showgrid();
}
catch (Exception)
{
}
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
if (e.CommandName == "show")
{
Session["fno"] = e.CommandArgument.ToString();
Response.Redirect("payment.aspx");
}
if (e.CommandName == "select")
{
Session["fno"] = e.CommandArgument.ToString();
da = new SqlDataAdapter("select c.id,c.cname,c.mobile,c.address,c.pstaff,c.pdate,c.colonyname,c.plotno,c.sector,c.floor,c.propertytype,c.size,c.esize,c.pdate,c.saledeedvalue,c.stamp,c.ramount,c.expenses,c.upexpenses,c.total,c.ndate,c.nremarks,d.total as alltotal from customer c join customer1 d on c.colonyname=d.colonyname and c.floor=d.floor and c.sector=d.sector and c.plotno=d.plotno and c.cname=d.cname where c.id=" + Session["fno"].ToString() + "", con);
dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
catch (Exception)
{
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
try
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
double dtt = Convert.ToDouble(((Label)e.Row.FindControl("Label2")).Text);
double dtt1 = Convert.ToDouble(((Label)e.Row.FindControl("Label1")).Text);
if (dtt==dtt1)
{
e.Row.BackColor = System.Drawing.Color.Red;
}
}
}
catch (Exception)
{
}
}
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
da = new SqlDataAdapter("select c.id,c.cname,c.mobile,c.address,c.pstaff,c.pdate,c.colonyname,c.plotno,c.sector,c.floor,c.propertytype,c.size,c.esize,c.pdate,c.saledeedvalue,c.stamp,c.ramount,c.expenses,c.upexpenses,c.total,c.ndate,c.nremarks,d.total as alltotal from customer c join customer1 d on c.colonyname=d.colonyname and c.floor=d.floor and c.sector=d.sector and c.plotno=d.plotno and c.cname=d.cname where c.cname='"+ DropDownList1.Text +"'", con);
dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
catch (Exception)
{
con.Close();
}
}
}
}
No comments:
Post a Comment