Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6898139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:15:29+00:00 2026-05-27T07:15:29+00:00

I want to create a report viewer in ASP.NET that presents to the users

  • 0

I want to create a report viewer in ASP.NET that presents to the users their data.
the data for all the users is located in the same table.

for now I created DBDataSet and in the TableAdapter there is this method

GetData(@idNumber, @userNumber)

in code behind of the screen that I want to show the report viewer I wrote:

FlightsDBDataSetTableAdapters.ReservationsTableAdapter ReservationsTableAdapter;
ReservationsTableAdapter = new FlightsDBDataSetTableAdapters.ReservationsTableAdapter();
FlightsDBDataSet.ReservationsDataTable newReservationTable;
newReservationTable = ReservationsTableAdapter.GetData(userId, userName);
ObjectDataSource1.SelectParameters.Add("userName", userName);
ObjectDataSource1.SelectParameters.Add("idNumber", userId);

when I run this I get the next error

An error has occurred during report processing. ObjectDataSource
‘ObjectDataSource1’ could not find a non-generic method
‘GetData(idNumber, userName)’ that has parameters: userName, idNumber.

SO, my question is where do I need to write the method GetData and how can I generate the report with the right data.

thanks a lot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:15:29+00:00Added an answer on May 27, 2026 at 7:15 am

    Try this out.

    1.Create a method which will return db null if parameter is not passed in the stored procedure

    public static object GetDataValue(object o)
    {
        if (o == null || String.Empty.Equals(o))
            return DBNull.Value;
        else
            return o;
    }
    

    2.Create a method which will called the stored procedure and fill the dataset.

    public DataSet GetspTest(string userName, string userId) {
    
    try
    {
        DataSet oDS = new DataSet();
        SqlParameter[] oParam = new SqlParameter[2];
    
    
        oParam[0] = new SqlParameter("@userName", GetDataValue(userName));
        oParam[1] = new SqlParameter("@idNumber", GetDataValue(userId));
    
        oDS = SqlHelper.ExecuteDataset(DataConnectionString, CommandType.StoredProcedure, "spTest", oParam);
        return oDS;
    }
    catch (Exception e)
    {
        ErrorMessage = e.Message;
        return null;
    }
    

    }

    1. Now you add the dataset let us say ‘DataSet1.xsd’
      Drag and Drop the TableAdapter and it will ask you the following details

      3.1 Connection String (Either Select the existing connection string or create new connection string)

      3.2 Choose Command Type (Now select the existing stored Procedure, specify the stored procedure with you have create earlier to display details in the report

      3.3 Choose Methods to Generate (check both Fill a Datatable and Return a datatable

      3.4 Click on Next and Submit ( Now your dataset is really to use in the report)

      1. Create a report and use this DataSet1 as datasource.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have data in 2 tables, and I want to create a report. Table
I want to create an Android application that show the sales report from SQL
I want to create report that will display information about Contracts and Cases. Contract
I have two table cpuinfo and jobinfo. I want to create report using both
I want to create a report, using either Crystal reports or RDLC, doesn't really
I want to create a report which aggregates the number of activities per customer
I have a JasperReport and I want to create for this report a cover
I want create wordpress website into which I want create user management... That means
I have an application that makes use of Report Viewer and Report (.rdlc) files.
My users want to be able to print a report I've designed in VS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.