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 308769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:40:51+00:00 2026-05-12T07:40:51+00:00

I have a web service that looks like this [WebMethod] public int Import(System.Collections.Generic.List<Record> importRecords)

  • 0

I have a web service that looks like this

    [WebMethod]
    public int Import(System.Collections.Generic.List<Record> importRecords)
    {
        int count = 0;
        if (importRecords != null && importRecords.Count > 1)
        {
            DataLayer datalayer = new DataLayer();
            foreach (Record brec in importRecords)
                if (rec != null) 
                {
                    datalayer.InsertUpdateRecord(rec);
                    count++;
                }
        }
        return count;
    }

And i have a client software that wants to send data to the web service using this method

 ImportService.BVRImportService importService = new ImportService.ImportService();
 ImportService.Record myRecord = new ImportService.Record();
 myRecord.FirstName = "Adam";
 System.Collections.Generic.List<ImportService.Record> myRecords = 
     new List<ImportService.Record>();
 myRecords.Add(myRecord);
 importService.ImportData(myRecords);

I keep getting this message when I try to compile the client software.

    Error   1   The best overloaded method match for 'ImportTask.ImportService.ImportService.ImportData(ImportTask.ImportService.Record[])' has some invalid arguments
Error   2   Argument '1': cannot convert from 'System.Collections.Generic.List<ImportTask.ImportService.Record>' to 'ImportTask.ImportService.BVRRecord[]'

Does anyone know what i’m doing wrong?

  • 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-12T07:40:51+00:00Added an answer on May 12, 2026 at 7:40 am

    It looks like the reference the client has contains an Record[] instead of a List<Record>. You can fix this by calling the .ToArray method on the List<Record>.

    importService.ImportData(myRecords.ToArray());
    

    I’m also confused by the use of Record in code but BVRRecord in the error messages. Are you changing the type names in your solution or are there actually 2 different types? If it’s the latter you’ll also need to convert to the BVRRecord type before calling ImportData.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ii have a web method that looks like this: [WebMethod] public int ImportData(System.Collections.Generic.List<Record> importRecords)
I have a web service that looks like this: public class TheService : System.Web.Services.WebService
Some existing web services I consume have methods that look something like this: List<Employee>
Using Grails and CXF, I have published a small web service that looks like
I have a WebMethod that looks like this which is used to populate a
I have a web service that queries data from this json file, but I
I have some web methods in an asmx web service that currently look like
Im trying to add an constructor to my webservice, that looks like this: public
Basically I have an XML file that looks like this: <?xml version=1.0 encoding=UTF-8?> <data>
Here's an interesting problem: I have some jQuery that looks like this: $(document).ready(function() {

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.