I have this setup as per the C# example (although i had to convert to VB) but i'm getting this error when trying to run the page...
Compiler Error Message: BC30002: Type 'var' is not defined.
Dim result As var = CampaignMonitorAPIWrapper.Subscriber.AddWithCustomFields(apiKey, listID, txtContactEmail.Text, Name, customFields)
I know you can declare a var in C# but not it VB.net which is what I am using so i guess the question is, what is the result, an integer, string or am i missing something?
The return type from the wrapper is Result<Integer>, so this should work:
Dim result as Result<Integer> = ...
You can also use inferred typing in VB.NET 2008 (which works the same way as the var keyword in C#), although you need to enable it in the project properties. See these links:
Thanks for your reply, opted for the following...
Dim result As Result(Of Integer) = CampaignMonitorAPIWrapper.Subscriber.AddWithCustomFields(apiKey, listID, txtContactEmail.Text, FullName, customFields)
Worked just fine. I think it would be very helpfull to include a VB version in samples.
Glad it is working, I see you fixed my incorrect VB generics syntax :-)
While there is no VB.NET sample, there are some places you can use to convert C# to VB:
You can also download an app to convert a whole project if you do a search.
From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.Get started for free