你好我想在sql server中保存一个日期时间数据类型的日期。在搜索屏幕中,我将参数作为唯一日期。
那么如何设置为查询?我的代码是:
<asp:SqlDataSource
ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:TAXIConnectionString %>"
SelectCommand="SELECT [TripId] FROM [BookingMaster]
WHERE ( ([PickupDateTime] = @PickupDateTime or @PickupDateTime is null))"
CancelSelectOnNullParameter="False">
<SelectParameters>
<asp:ControlParameter ControlID="txtBookingDate"
Name="PickupDateTime" PropertyName="Text" Type="String"
ConvertEmptyStringToNull="true" />
</SelectParameters>
</asp:SqlDataSource>