473,326 Members | 2,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

too many arguments to 'Public Sub New()'

I have the following class in C# with two constructors
--------------
public class JobfolderEmailRecord
{
public JobfolderEmailRecord(int Id)
{
//code for constructor
}
public JobfolderEmailRecord(EmailTypeEnum EmailType, string strReference,
int intDepartmentId, int intJobfolderId, string strSubject, string
strRecipientEmail, string strRecipientName, string strSenderEmail, string
strSenderName)
{
//code for constructor
}
//more code for class
}
-------------

I reference and Import the dll from a ASP.Net project written in VB.Net

When I call JobfolderEmailRecords constructor i get the error:
"too many arguments to 'Public Sub New()'"

It seemt the VB.Net code can't see the constructor signatures, VB.Net only
sees a constructor with no arguments, but I don't even have such a
constructor. The funny thing is that all other method calls to the class
seem to parse just fine, and the code that produces the error used to work
before I recompiled the dll containing the JobfolderEmailRecord class.

I've tried to unload and reload the project but it doesn't help.

Can anyone help?

Kind Regards,
Allan Ebdrup
Nov 21 '05 #1
1 10049
Figured it out, my webservice was named the same as my object so I was
trying to new the webservice, including the entire namespace path to my
class when newing it solved the problem.
Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Eric Chong | last post by:
I created a Windows Service in C# that requires to get passed command arguments like a Console App. I noticed that there is an option "Start parameters" text box in the property of a Windows...
11
by: The Directive | last post by:
This code will not compiled: In main function: Dot temp = new Dot( *(new Point( 5, 5 )) ); In Dot class: //Constructor with default arguments. Dot::Dot( Point& point= *(new Point( 5, 5...
5
by: Pelle Beckman | last post by:
Hi, I've done some progress in writing a rather simple singleton template. However, I need a smart way to pass constructor arguments via the template. I've been suggested reading "Modern C++...
10
by: Andrew Bullock | last post by:
Hi, code: myClass x = new myClass(); x.dosomethingwith(x,y); How do i make dosomethingwith(x,y) run on a separate thread, and then inform the main thread when it has finished?
12
by: Nick Hounsome | last post by:
Can anyone tell me what the rational is for not supporting optional arguments. It is obviously a trivial thing to implement and, since C++ has them, I would not expect them to be omitted without...
1
by: tbandrow | last post by:
I would like to get this to compile: public class GenericCtor<T> where T: class, new() { public static T MakeIt() { return new T(1, 2); } }
2
by: prasanthag | last post by:
Hi, I am a newbie to this group. I have a problem in handling the variable arguments passed to a function. My requirement is like this. I have 2 functions say, void funcX(int i, int j);...
1
by: Suds | last post by:
Hi, I'm having an issue with invoking a Generic method that takes Generic Arguments. My method signature is public void GenericMethodWithGenericArguments<E, V>(List<EtheFirstList,...
17
Freckles
by: Freckles | last post by:
Hi! I've been trying to get my inventory program to compile, but haven't had any luck. My instructor tells me that my arguments in the Inventory3 class need to match the datatype of the constructor...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.