reportviewer datetime error !! RRS feed

  • Question

  • User-1029010542 posted

    I am trying to populate a report viewer based on datetime parameters , but im getting a error stating : 

    • An error has occurred during report processing.
      • Conversion failed when converting date and/or time from character string.

    now i know that i have to convert to datetime but where ????

     <form id="form1" runat="server">
            <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
                DataSourceID="SqlDataSource1" DataTextField="login" 
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:practiceConnectionString %>" 
                SelectCommand="SELECT DISTINCT login FROM tbl_logs">
            <br />
            <br />
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            <br />
            <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" 
                Font-Size="8pt" InteractiveDeviceInfos="(Collection)" 
                WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="876px">
                <LocalReport ReportPath="Report.rdlc">
                        <rsweb:ReportDataSource DataSourceId="SqlDataSource2" Name="DataSet1" />
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                ConnectionString="<%$ ConnectionStrings:practiceConnectionString %>" 
                SelectCommand="SELECT LogID, UserName, IP, login, logout, logintime, logouttime FROM tbl_logs WHERE (login = @login)">
                    <asp:ControlParameter ControlID="DropDownList1" Name="login" 
                        PropertyName="SelectedValue" Type="String" />
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            <br />
            <br />
            <br />
            <br />

    the login field in my db is a datetime type

    any help ????

    Thursday, April 3, 2014 3:29 AM


All replies