Last post Dec 19, 2007 08:23 PM by atconway
Dec 05, 2006 12: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 12: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 12:03 PMfirstname.lastname@example.org|LINK
Dec 19, 2007 05:43 PM|sabena248|LINK
I have the same error:
Dec 19, 2007 05: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 06:02 PM|sabena248|LINK
Thanks for the reminder, that helped!
Dec 19, 2007 07:50 PM|kraznodar|LINK
As String =
That should fix the issue
Dec 19, 2007 07:56 PM|sabena248|LINK
Thanks Alot I got it fixed!
Dec 19, 2007 08: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.