locked
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">
        <div>
        
            <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
                DataSourceID="SqlDataSource1" DataTextField="login" 
                DataValueField="login">
            </asp:DropDownList>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:practiceConnectionString %>" 
                SelectCommand="SELECT DISTINCT login FROM tbl_logs">
            </asp:SqlDataSource>
            <br />
            <br />
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <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">
                    <DataSources>
                        <rsweb:ReportDataSource DataSourceId="SqlDataSource2" Name="DataSet1" />
                    </DataSources>
                </LocalReport>
            </rsweb:ReportViewer>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                ConnectionString="<%$ ConnectionStrings:practiceConnectionString %>" 
                
                SelectCommand="SELECT LogID, UserName, IP, login, logout, logintime, logouttime FROM tbl_logs WHERE (login = @login)">
                <SelectParameters>
                    <asp:ControlParameter ControlID="DropDownList1" Name="login" 
                        PropertyName="SelectedValue" Type="String" />
                </SelectParameters>
            </asp:SqlDataSource>
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                SelectMethod="GetData" 
                TypeName="practiceDataSetTableAdapters.tbl_logsTableAdapter">
            </asp:ObjectDataSource>
            <br />
            <br />
            <br />
            <br />
        
        </div>
        </form>

    the login field in my db is a datetime type

    any help ????

    Thursday, April 3, 2014 3:29 AM

Answers

All replies