在两次约会之间录制唱片
本文关键字:之间 唱片 约会 两次 | 更新日期: 2023-09-27 18:13:32
我想连接到SQL数据库和过滤我的记录基于日期与年和月和日期和小时。
我可以显示从最后一天早上7点到系统日期之间的所有记录,但我想创建一个按钮作为名称过滤和两个文本框作为名称开始日期和结束日期。
在后面的代码中,我无法连接到我的网络通行证。请帮帮我
<UpdateParameters>
<asp:Parameter Type="String" name="RfidDate"></asp:Parameter>
<asp:Parameter Type="String" name="InorOut"></asp:Parameter>
<asp:Parameter Type="String" Name="codemahsol" />
<asp:Parameter Type="String" Name="shomarekhatetolid" />
<asp:Parameter Type="string" Name="tmahsol" />
<asp:Parameter Type="string" Name="DESC" />
</UpdateParameters>
</asp:SqlDataSource>
<table class="style" runat="server">
<tr>
<td colspan="2" style="text-align:center">
<b>Filtring message between date</b></td>
</tr>
<tr>
<td>
<asp:Label ID="lblstartdate" runat="server" Text="starting date"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtstartingdate" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblendingdate" runat="server" Text="ending date"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtendingdate" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblfilter" runat="server" Text="Filtering"></asp:Label>
</td>
<td>
<asp:Button ID="btnfilter" runat="server" Text="Filtering" Width="81px" OnClick="btnfilter_click" />
</td>
</tr>
</table>
<asp:GridView ID="gdvRfids" runat="server" DataSourceID="sdsRfids" AllowPaging="false" AllowSorting="true" AutoGenerateColumns="false" >
<PagerStyle BackColor="Gray" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="Black" ForeColor="White" />
<AlternatingRowStyle BackColor="LightGray" />
<columns>
<asp:CommandField ButtonType="Button" ShowEditButton="false" />
<asp:BoundField HeaderText="codemahsol" DataField="codemahsol" SortExpression="codemahsol" />
<asp:BoundField HeaderText="tmahsol" DataField="tmahsol" SortExpression="tmahsol" />
<asp:BoundField HeaderText="shomarekhatetolid" DataField="shomarekhatetolid" SortExpression="shomarekhatetolid" />
<asp:BoundField HeaderText="InorOut" DataField="InorOut" SortExpression="InorOut" >
</asp:BoundField>
<asp:BoundField HeaderText="DESC" DataField="DESC" SortExpression="DESC" />
<asp:TemplateField HeaderText="select">
<ItemTemplate>
<asp:CheckBox ID="chkselect" runat="server" />
</ItemTemplate>
<HeaderTemplate>
</HeaderTemplate>
</asp:TemplateField>
<asp:BoundField />
</columns>
</asp:GridView>
<asp:Button ID="btnGetRecord" Text="Get Selected Records" runat="server" Font-Bold="true" OnClick="btnGetRecord_Click" /><br /><br />
<asp:Label ID="lblRecord" runat="server"></asp:Label>
</div>
</form>
<script type="text/javascript">
function CheckAll(Checkbox) {
var DridVwHeaderCheckbox = document.getElementsByTagName("<%=gdvRfids %>");
for (i = 1; i < DridVwHeaderCheckbox.row.lenght; i++) {
DridVwHeaderCheckbox.row[i].cell[0].getElementsByTagName("INPUT")
[0].checked = Checkbox.checked;
}
}
</script>
您需要将日期转换为MM/dd/yyyy HH:mm
格式并在数据库中获取记录
DataRow[] TempRow = Table.Select("((Entry_Time) >= #" +
StartDate.ToString("MM/dd/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture) + "#) AND ((Entry_Time)<=#" +
EndDate.ToString("MM/dd/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture) + "#)");