This is a migrated thread and some comments may be shown as answers.

No overload for method 'Fill' takes '1' arguments

11 Answers 533 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
IQworks
Top achievements
Rank 1
IQworks asked on 06 Sep 2009, 05:59 AM
Hi,
    I am trying to find out if my solution is correct, and if so, if there is anything else I should be aware of. Or, If there is a better way, what might that be ?    If this is wrong (even though it builds) what is the correct way of doing this ?

This is the fill error i was getting after i added a parameter to one of the tables in the report. 

 

In my report.xsd, I found the Fill method in the xsd's Designer.cs. 

 

this is what I did. I found the method holding the two parameters. It included the datatable as a parm and the MemberParm which is the name I gave the new parameter in this report.

I copied this method .......

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]  
        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]  
        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]  
        public virtual int Fill(iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTableDataTable dataTable, int MemberParm) {  
            thisthis.Adapter.SelectCommand = this.CommandCollection[0];  
            this.Adapter.SelectCommand.Parameters[0].Value = ((int)(MemberParm));  
            if ((this.ClearBeforeFill == true)) {  
                dataTable.Clear();  
            }  
            int returnValue = this.Adapter.Fill(dataTable);  
            return returnValue;  
        }  
 

To here. Then, I just commented out the signiture line and replaced it with a line that only included the datatable parm, now. Of course I had to comment out the two lines pertaining to the MemberParm as well,   now I had a fill method with one parm .......

 (the lines I commented out start with // iqworks) 

 

// iqworks   
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]  
        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]  
        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]  
       //iqworks public virtual int Fill(iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTableDataTable dataTable, int MemberParm)  
        public virtual int Fill(iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTableDataTable dataTable)  
       {  
       //iqworks     thisthis.Adapter.SelectCommand = this.CommandCollection[0];  
       // iqworks     this.Adapter.SelectCommand.Parameters[0].Value = ((int)(MemberParm));  
            if ((this.ClearBeforeFill == true))  
            {  
                dataTable.Clear();  
            }  
            int returnValue = this.Adapter.Fill(dataTable);  
            return returnValue;  
        }  
         // end of iqworks  
 

I placed the cursor over the class lib name, right clicked and hit Build, the build was successful this time.
I saw posts that lead me to documentation that told me "I needed to add a method" but it never told me "where to go to add the method" ?
Anyway, is there anything else I need to do ?
Seems like this should automatically be done just like it automatically adds or changes the original one method with the new parameter ? Not sure ? 
thanks

11 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 07 Sep 2009, 08:41 AM
Hi IQworks,

The dataset files should not be modified manually and you should always use the dataset designer for such purposes. We cannot conclude what is it you're trying to achieve from the information you've provided, but we've certainly not advised to alter the dataset files by hand. If you're binding the report to your own dataset (i.e. not created by the report wizard), then you need to add the Fill method for the dataset in the report constructor (which is what the report wizard does automatically for you) i.e.:

 try
            {
                this.productCategoriesDataSetTableAdapter1.Fill(this.productCategoriesDataSet.ProductCategoriesDataSetTable);
            }
            catch (System.Exception ex)
            {
                // An error has occurred while filling the data set. Please check the exception for more information.
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }

If still having problems, please start by explaining what is it you're trying to achieve and how you've got there.

Sincerely yours,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
IQworks
Top achievements
Rank 1
answered on 10 Sep 2009, 02:14 AM
    I create a parameter and starting getting a message about thier being no Fill method with 1 param.
    I saw the only Fill method I had having the default param and the new param I added.
0
IQworks
Top achievements
Rank 1
answered on 11 Sep 2009, 07:47 PM
My Mistake, I thought that I include what the error message was in my first post - that probably would of helped.
If my last response was not clear, and I cannot send you a print screen, here is what I did and here is the error I got ....

In the designer (report wizard), I called up an existing report,
1) Right clicked on the dataset that was in the pane under the "Row Groups" and 
    "Column groups".
2) Selected "Edit in dataset designer".  
3) Right clicked on the dataset and selected "Configure".
4) Added a new Parameter to the SQL (@MemberParm). 
SELECT     Equipment.eqEquipmentNo, Equipment.eqEquipmentName, Locations.loLocation, Locations.loDescription, Members.mbUserName,   
                      Types.tpTypeName, Types.tpTypeDescription, Equipment.eqEquipmentTypeNo, Types.tpTypeCode, Equipment.eqMemberNo  
FROM         Equipment INNER JOIN 
                      Locations ON Equipment.eqMemberNo = Locations.loMemberNo AND Equipment.eqEquipmentLocNo = Locations.loNumber INNER JOIN 
                      Types ON Equipment.eqEquipmentTypeNo = Types.tpMemberNo AND Equipment.eqEquipmentTypeNo = Types.tpTypeNo INNER JOIN 
                      Members ON Equipment.eqMemberNo = Members.mbMemberNo   
WHERE mbMemberNo=@MemberParm 

5) Tried to preview the report. 
6) Got the error message:  
    Build Failed.
    No overload for method 'Fill' takes '1' arguments.

  Your last post said it should add the fill() method for me automatically. This was true for me when I created the report and the initial this initial dataset, but for some reason, adding a parm caused the program to take the original Fill method and add the new parm to IT !  Thus leaving the class without a method with the original one parm signiture. If this process was to have resulted in TWO
Fill methods now, it did not do it here. I am not sure why.
  From reading documentation, I did not see where or how to use the designer to add a Fill() method with the correct signiture ? I guess that may be because it was suppose to do it automatically. Thats why I thought I had to find where and how to do it myself. 
   I guess I understand what you mean when you say i should not alter the dataset by hand, but then you say I need to go in an add the Fill method. I think what you are saying is that if I use the report wizard, I shouldnt have to add anything, but In my case, I am using the designer as you can see, but I get the error that leads me to believe that I still need to add the method manually ?
   Perhaps there is something I am missing ?
   Not sure what I need to do here - can you advise me ?

thanks for your time with this.


 
0
IQworks
Top achievements
Rank 1
answered on 11 Sep 2009, 07:55 PM
I should also add what my report program looks like with this error message.
namespace iqReports_lib  
    {  
    using System;  
    using System.ComponentModel;  
    using System.Drawing;  
    using System.Windows.Forms;  
    using Telerik.Reporting;  
    using Telerik.Reporting.Drawing;  
 
    /// <summary>  
    /// Summary description for iqEquipment_Summary.  
    /// </summary>  
    public partial class iqEquipment_Summary : Telerik.Reporting.Report  
        {  
        public iqEquipment_Summary()  
            {  
            /// <summary>  
            /// Required for telerik Reporting designer support  
            /// </summary>  
            InitializeComponent();  
 
            //  
            // TODO: Add any constructor code after InitializeComponent call  
            //  
 
            // TODO: This line of code loads data into the 'iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTable' table. You can move, or remove it, as needed.  
            try 
                {  
                this.iqBodyWorksV02DataSetEquipmentSummaryTableAdapter1.Fill(this.iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTable);  
                }  
            catch (System.Exception ex)  
                {  
                // An error has occurred while filling the data set. Please check the exception for more information.  
                System.Diagnostics.Debug.WriteLine(ex.Message);  
                }  
 
            // TODO: This line of code loads data into the 'iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTable' table. You can move, or remove it, as needed.  
            try 
                {  
                this.iqBodyWorksV02DataSetEquipmentSummaryTableAdapter1.Fill(this.iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTable);  
                }  
            catch (System.Exception ex)  
                {  
                // An error has occurred while filling the data set. Please check the exception for more information.  
                System.Diagnostics.Debug.WriteLine(ex.Message);  
                }  
 
            // TODO: This line of code loads data into the 'iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTable' table. You can move, or remove it, as needed.  
            try 
            {  
                this.iqBodyWorksV02DataSetEquipmentSummaryTableAdapter1.Fill(this.iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTable);  
            }  
            catch (System.Exception ex)  
            {  
                // An error has occurred while filling the data set. Please check the exception for more information.  
                System.Diagnostics.Debug.WriteLine(ex.Message);  
            }  
 
            // TODO: This line of code loads data into the 'iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTable' table. You can move, or remove it, as needed.  
            try 
            {  
                this.iqBodyWorksV02DataSetEquipmentSummaryTableAdapter1.Fill(this.iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTable);  
            }  
            catch (System.Exception ex)  
            {  
                // An error has occurred while filling the data set. Please check the exception for more information.  
                System.Diagnostics.Debug.WriteLine(ex.Message);  
            }  
 
            // TODO: This line of code loads data into the 'iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTable' table. You can move, or remove it, as needed.  
            try 
            {  
                this.iqBodyWorksV02DataSetEquipmentSummaryTableAdapter1.Fill(this.iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTable);  
            }  
            catch (System.Exception ex)  
            {  
                // An error has occurred while filling the data set. Please check the exception for more information.  
                System.Diagnostics.Debug.WriteLine(ex.Message);  
            }  
 
            // TODO: This line of code loads data into the 'iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTable' table. You can move, or remove it, as needed.  
            try 
            {  
                this.iqBodyWorksV02DataSetEquipmentSummaryTableAdapter1.Fill(this.iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTable);  
            }  
            catch (System.Exception ex)  
            {  
                // An error has occurred while filling the data set. Please check the exception for more information.  
                System.Diagnostics.Debug.WriteLine(ex.Message);  
            }  
 
            // TODO: This line of code loads data into the 'iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTable' table. You can move, or remove it, as needed.  
            try 
            {  
                this.iqBodyWorksV02DataSetEquipmentSummaryTableAdapter1.Fill(this.iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTable);  
            }  
            catch (System.Exception ex)  
            {  
                // An error has occurred while filling the data set. Please check the exception for more information.  
                System.Diagnostics.Debug.WriteLine(ex.Message);  
            }  
            }  
        }  
    } 
 
 The problem is all of the lines that say ... 
this.iqBodyWorksV02DataSetEquipmentSummaryTableAdapter1.Fill .iqBodyWorksV02DataSetEquipmentSummary.iqBodyWorksV02DataSetEquipmentSummaryTable);
have a blue underline. Hovering over this underline displays ...
"No overload for method 'Fill' takes '1' arguments"
0
Steve
Telerik team
answered on 14 Sep 2009, 09:31 AM
Hello IQworks,

Thank you for the clarification - it seems that your confusion comes from the fact that you've added a WHERE clause in your SQL query i.e. added a MemberParm parameter, which of course means that the Fill method would not require a second argument - value for the introduced param in your query. Changes to an already existing dataset are not tracked by the report and that is the reason the Fill method has not changed in the try-catch block. We noticed that in your report constructor you have multiple Fill methods that all fill the iqBodyWorksV02DataSetEquipmentSummaryTable, so please remove all replicas and leave a single try-catch block for that table.
Now if you place a comma after iqBodyWorksV02DataSetEquipmentSummaryTable, Intellisense should show you that the Fill method expects a second argument for the MemberParm parameter, which you need to specify.
I've prepared a sample report that uses as datasource, a dataset that is not created by the report wizard (i.e. manually added parameter) and shows you how the Fill method should look like.

Sincerely yours,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
IQworks
Top achievements
Rank 1
answered on 15 Sep 2009, 02:37 AM

Steve,

   Thanks very much for the explanation on the Fill method, it was very helpful. And for the sample project.

    I loaded the project you sent into my VS2008, I added the Telerik.Report.Processing to the references, but  I ran into a problem calling up the Report1.cs.     It has using Telerik.Reporting.Drawing; But I get "The type or namespace name 'Drawing' does not exist in the namespace"..

 

 

.  But I am using this Telerik.Reporting.Drawing  namespace no problem in the other report (the one I sent you) I have in my other project. I know this is probably simple, but can you tell me where or what to do to have this recognized in your sample project ? 
this is my report .... (My project name is also iqReports_lib).

namespace iqReports_lib  
{  
    using System;  
    using System.ComponentModel;  
    using System.Drawing;  
    using System.Windows.Forms;  
    using Telerik.Reporting;  
    using Telerik.Reporting.Drawing;  
 
    /// <summary> 
    /// Summary description for iqEquipment_Summary.  
    /// </summary> 
    public partial class iqEquipment_Summary : Telerik.Reporting.Report  
    {  
 
        public iqEquipment_Summary()  
        {  
            /// <summary> 
            /// Required for telerik Reporting designer support  
            /// </summary> 
            InitializeComponent();  
 

This is from the project you sent me (In VS2008, the "Drawing" and the "Report" in "Telerik.Reporting.Report" are underlined in 
blue ? .... I used the project name "SampleDSimmons" the way I recieved it, so, it is not named "MasterDetailNeedDataSource "  ,  this may have something to do with it ? I tried to rename the "SampleDSimmons" project to "MasterDetailNeedDataSource "  but that build failed with the same message ?
namespace MasterDetailNeedDataSource  
{  
    using System;  
    using System.ComponentModel;  
    using System.Drawing;  
    using System.Windows.Forms;  
    using Telerik.Reporting;  
    using Telerik.Reporting.Drawing;  
    using MasterDetailNeedDataSource.DetailDataSetTableAdapters;  
 
    /// <summary> 
    /// Summary description for Report1.  
    /// </summary> 
    public partial class Report1 : Telerik.Reporting.Report  
    {  
        public Report1()  
        {  
            /// <summary> 
            /// Required for telerik Reporting designer support  
            /// </summary> 
            InitializeComponent();  
 

  Also,     Thanks for your advice ....
0
Steve
Telerik team
answered on 15 Sep 2009, 07:13 AM
Hi IQworks,

The sample I've sent is runnable out of the box. The problem is that you're obviously using an older version of the product, since in Q2 we've decreased the number of assemblies to 3: Telerik.Reporting, Telerik.ReportViewer.WinForms and Telerik.ReportViewer.WebForms, having in mind that the last two are used depending on the type of project you're working on. Telerik.Report.Processing assembly is not merged into Telerik Reporting, so simply upgrade to the latest version and run the project as is without adding to other existing solutions - no need for changing namespaces is required.

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
IQworks
Top achievements
Rank 1
answered on 15 Sep 2009, 03:50 PM
Thanks Steve,
   I will upgrade between today and tommorrow and try again.
   Which and where is the best place to go for the correct upgrade ? Do I have to apply each upgrade until I get to the latest version ? Or can I just upgrade to the latest version ? 
   I am anxious to learn how my basic reporting environment should be.
thanks again.
0
Steve
Telerik team
answered on 15 Sep 2009, 03:54 PM
Hi IQworks,

You can install Q2 SP1 directly and use the Upgrade Wizard to take care of the updates for you. The only thing you might need to do is remove obsolete assemblies from the references as they no longer exist e.g. Telerik.Reporting.Processing.dll etc.

Greetings,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
IQworks
Top achievements
Rank 1
answered on 16 Sep 2009, 12:26 AM
Ok, 
   Got sidetracked today ...
    I think I am suppose to download and apply  ? (Then run the wizard from the Telerik menu option in my VS2008)......    

Q2 2009 SP1 (version 3.1.9.807)

8/7/2009 12:00:00 AM 

    I am thinking this SP1 is just for Telerik Reporting, not for all RadControls - Is there one for all RadControls ?
    Any place I can go to read about Telerik service packs and how to apply them ?

0
IQworks
Top achievements
Rank 1
answered on 16 Sep 2009, 01:02 AM
ok, I found this link ..... 

 

http://www.telerik.com/account/downloads.aspx 

It Shows an msi file 47MB Latest Version 2009.2.807 (Aug 7, 2009) - IS THIS WHAT I NEED TO

DOWNLOAD AND IS THIS THE REPORTING SP1 THAT I NEED ? IF SO, I GUESS I WILL RUN
THE WIZARD AFTER DOWNLOADING AND APPLYING THIS msi ?

Tags
General Discussions
Asked by
IQworks
Top achievements
Rank 1
Answers by
Steve
Telerik team
IQworks
Top achievements
Rank 1
Share this question
or