0% found this document useful (0 votes)
7 views4 pages

SQL String Search Techniques

This document contains code for querying a database table to retrieve fee payment details between two dates. It selects data from the VWFeeDetails table, fills a dataset, and binds the results to a GridView if rows are returned. It also contains code for a Repeater control that displays the fee payment records in a table with labels bound to the column values.

Uploaded by

raj143nag
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

SQL String Search Techniques

This document contains code for querying a database table to retrieve fee payment details between two dates. It selects data from the VWFeeDetails table, fills a dataset, and binds the results to a GridView if rows are returned. It also contains code for a Repeater control that displays the fee payment records in a table with labels bound to the column values.

Uploaded by

raj143nag
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

String sql = "select ReceiptNo,CName,Convert(char(20),PaidDate,105) as

PaidDate,PaidAmount,PaymentMode from VWFeeDetails where PaidDate between '" +


[Link]([Link]) + "' and '" +
[Link]([Link]) + "'";
SqlCommand cmd = new SqlCommand(sql, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
[Link](ds, "VWFeeDetails");
dt = [Link]"VWFeeDetails",;
if ([Link] == 0)
,
[Link] = false;

[Link]([Link](), "",
"<script language=\"javaScript\"" + "alert('No Data Found To Display');" +
"<" + "/script");
,
else
,
[Link] = true;
[Link] = dt;
[Link]();

,
,



<asp:Repeater ID="Repeater1" runat="server"
<HeaderTemplate
<table border="1" cellpadding="3" cellspacing="1"
id="tblNotice" width="100%" id="container"
<tr bgcolor="#ccffff" style="cursor:default"
<td
<bReceipt No</b
</td
<td
<bAdmission No</b
</td
<td
<bStudent Name</b
</td
<td
<bClass Name</b
</td
<td
<bPaid By</b
</td
<td
<bPaid Date</b
</td
<td
<bPaid Amount</b
</td
<td
<bPayment Mode</b
</td
<td
<bFee Due</b
</td
</tr
</HeaderTemplate
<ItemTemplate
<tr style="background-color:White"

<%-- <tr bgcolor="White"
onclick="javascript:SearchNotice(this,'<%# Eval("ID")%')"
onmouseover="[Link] = '#FFFFD2'"
onmouseout="[Link] = 'white'" style="cursor:pointer"
onmousedown="[Link]='#D6FFC1'"--%
<td
<asp:Label ID="Label1" runat="server" Text='<%#
Eval("ReceiptNo") %'</asp:Label
</td
<td
<asp:Label ID="Label6" runat="server" Text='<%#
Eval("AdminNo") %'</asp:Label
</td
<td
<asp:Label ID="Label2" runat="server" Text='<%#
Eval("StudentName") %'</asp:Label
</td
<td
<asp:Label ID="Label3" runat="server" Text='<%#
Eval("CName") %'</asp:Label
</td
<td
<asp:Label ID="Label4" runat="server" Text='<%#
Eval("Paidby") %'</asp:Label
</td
<td
<asp:Label ID="Label5" runat="server" Text='<%#
Eval("PaidDate") %'</asp:Label
</td
<td
<asp:Label ID="Label10" runat="server" Text='<%#
Eval("PaidAmount") %'</asp:Label
</td
<td
<asp:Label ID="Label11" runat="server" Text='<%#
Eval("PaymentMode") %'</asp:Label
</td
<td
<asp:Label ID="Label12" runat="server" Text='<%#
Eval("JutSourceingDue") %'</asp:Label
</td
</tr
</ItemTemplate
<AlternatingItemTemplate
<%--<tr style="background-color:Silver"--%
<tr style="background-color:silver"
<%--<tr bgcolor="White"
onclick="javascript:SearchNotice(this,'<%# Eval("ID") %')"
onmouseover="[Link] = '#FFFFD2'"
onmouseout="[Link] = 'white'" style="cursor:pointer"
onmousedown="[Link]='#D6FFC1'"--%
<td
<asp:Label ID="Label7" runat="server" Text='<%#
Eval("ReceiptNo") %'</asp:Label
</td
<td
<asp:Label ID="Label8" runat="server" Text='<%#
Eval("AdminNo") %'</asp:Label
</td
<td
<asp:Label ID="Label9" runat="server" Text='<%#
Eval("StudentName") %'</asp:Label
</td
<td
<asp:Label ID="Label3" runat="server" Text='<%#
Eval("CName") %'</asp:Label
</td
<td
<asp:Label ID="Label4" runat="server" Text='<%#
Eval("Paidby") %'</asp:Label
</td
<td
<asp:Label ID="Label5" runat="server" Text='<%#
Eval("PaidDate") %'</asp:Label
</td
<td
<asp:Label ID="Label10" runat="server" Text='<%#
Eval("PaidAmount") %'</asp:Label
</td
<td
<asp:Label ID="Label11" runat="server" Text='<%#
Eval("PaymentMode") %'</asp:Label
</td
<td
<asp:Label ID="Label12" runat="server" Text='<%#
Eval("JutSourceingDue") %'</asp:Label
</td
</tr
</AlternatingItemTemplate
<FooterTemplate
</table
</FooterTemplate
</asp:Repeater






select CName,ClassCode,Section, sum( case when gender = 'male' then 1 else 0
end ) as Boys , sum( case when gender = 'female' then 1 else 0 end ) as Girls
,count() as total from vwStudentFullDetails group By CName,ClassCode,Section






Class Name Section Boys Girls Total

You might also like