locked
Cross-Tab query displayed in Gridview with parameters inputted from the asp.net page RRS feed

  • Question

  • User1312450783 posted

    I know there are issues using a crosstab query with sql server - but was hoping that I could get a crosstab  query with a MS Access backend to display properly in a gridview in my asp.net page.  At one point, I actually had this gridview displaying properly, but now can't even seem to get that working. Ultimately I need to have a date range as selected from txt boxes in the asp.net page to be additional parameters for the cross-tab query - but first just need to get the data to display properly in gridview.


    Below is my code for the Access Data Source that the gridview is bound to. I get the "

    No value given for one or more required parameters."

    error whenever this page loads - - but at one point this page was actually displaying fine.

    *********************************

    <asp:AccessDataSource ID="AccessDataSource1" runat="server"
                                        DataFile="~/Data1.mdb"
                                        
                                        SelectCommand= "TRANSFORM Sum(EmployeeHours.Hours) AS SumOfHours
    SELECT [EmployeeHours].[Employee], Sum([EmployeeHours].[Hours]) AS [Total Of Hours]
    FROM EmployeeHours LEFT JOIN Employee ON [EmployeeHours].[Employee] = [Employee].[Username]

    GROUP BY [EmployeeHours].[Employee]
    PIVOT [EmployeeHours].[Building]">
     

    </asp:AccessDataSource>


    *****************

    Any help is greatly appreciated!

    Monday, August 9, 2010 11:07 AM

Answers

  • User-1199946673 posted

    No value given for one or more required parameters."
     

    this error ussually means that you mispelled either a field or table name in your query!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 9, 2010 12:00 PM

All replies

  • User-1199946673 posted

    No value given for one or more required parameters."
     

    this error ussually means that you mispelled either a field or table name in your query!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 9, 2010 12:00 PM
  • User1312450783 posted

    Yes. I thought the same thing - but have double checked all of the field names. Also, I directly cut and pasted the sql from the query after running it successfully within Access.

    Tuesday, August 10, 2010 9:31 AM