Last post Dec 19, 2007 09:23 PM by atconway
Dec 05, 2006 01:09 PMemail@example.com|LINK
I am getting an error like as follows
What might be the reason?
Overload resolution failed because no accessible 'New' accepts this number of arguments.
My code is as follows
Dim list As DataListItem
strSubLocationIds = String.Empty
For Each list………………………………………
Dec 05, 2006 01:53 PM|jose_jimenez|LINK
A string object does not have to be instantiated with the New syntax.
Private strSubLocationIds as String
is enough. If you want to be sure what the value is set it to "" as in
Private strSubLocationIds as String = ""
Apr 05, 2007 01:03 PMfirstname.lastname@example.org|LINK
Dec 19, 2007 06:43 PM|sabena248|LINK
I have the same error:
Dec 19, 2007 06:47 PM|Curt_C|LINK
Do you have a Constructor for IPClass that accepts all those params, of that type, in that way? Doubt it.
P.S.... you should start a new thread, not tack on to an old one that isn't really relevant to yours. Same error sure, but completely different process
Dec 19, 2007 07:02 PM|sabena248|LINK
Thanks for the reminder, that helped!
Dec 19, 2007 08:50 PM|kraznodar|LINK
As String =
That should fix the issue
Dec 19, 2007 08:56 PM|sabena248|LINK
Thanks Alot I got it fixed!
Dec 19, 2007 09:23 PM|atconway|LINK
If you want a string object you must include parameters for the object constructor; it looks like the String object has 3 overloads. There is no parameterless constructor for a string object and that is why you receive the exception. The string you want
in Dim MyString As String = String.Empty.