FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister  MasterVB.NET
Visual Basic 2005 .NET Forum
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Problem with incompatible types and API Call (Argument match
 
Post new topic   Reply to topic    MasterVB.NET Forum Index -> Smart Device Application
View previous topic :: View next topic  
Message
Author
BradleyPeter
Beginner
Joined: 11 Jul 2006
Posts: 150

PostPosted: Thu Jul 13, 2006 1:00 am    
Post subject: Problem with incompatible types and API Call (Argument matching parameter 'parameter' cannot convert from 'Type' to 'Type()'
Reply with quote
You second parameter looks wrong. I guess you need to drop the parentheses. Is there a good reason for them being there?


Peter


-----Original Message-----
From: DotNetDevelopment on behalf of jmoore1999 Sent: Wed 7/12/2006 4:10 PM To: DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting Cc:
Subject: [DotNetDevelopment] Problem with incompatible types and API Call (Argument matching parameter 'parameter' cannot convert from 'Type' to 'Type()'


I am trying to use an api for a list manager program to perform what i thought would be a fairly easy task of updating user information. I am fairly new at asp.net so i will thank you in advance for your patience.



The API method is called UpdateMemberDemographics and requires the two parameters, simpleMemberStruct and KeyValueType. The List Managment program has documentation for each of these at the following location.
(http://lyris.com/help/lm_api/9.0/)

When i try to run the code below i receive the following error:
--------------------------------------------------------------------------------------------------------------------------------------------------
Method invocation failed because 'Public Function UpdateMemberDemographics(SimpleMemberStructIn As lmapiSoap.SimpleMemberStruct, DemographicsArray As lmapiSoap.KeyValueType()) As Boolean' cannot be called with these arguments: Argument matching parameter 'DemographicsArray' cannot convert from 'KeyValueType' to 'KeyValueType()'.
--------------------------------------------------------------------------------------------------------------------------------------------------

Dim lm = New lmapi()
Dim lmUsername As String = "adminUsername"
Dim lmPassword As String = "adminPassword"
lm.Credentials = New NetworkCredential(lmUsername, lmPassword)

If lm.ApiVersion() <> "1.5 beta" Then
Response.Write("Incorrect API Version! :" +
lm.ApiVersion())
End If

Dim keyvaluetypes As New lmapiSoap.KeyValueType()
keyvaluetypes.Name = "Field Name to Modify"
keyvaluetypes.Value = "New Value for Field"

Dim simpleMember As New SimpleMemberStruct()
simpleMember.ListName = "listname"
simpleMember.EmailAddress = "email"

lm.UpdateMemberDemographics(simpleMember, keyvaluetypes)
--------------------------------------------------------------------------------------------------------------------------------------------------

I assume the problem is that the object i create using the keyValueType type is not in the array form and the parameter should be. One thing i have yet to completely grasp is the difference between a "keyValueType"
and "keyValueType()" or for that matter any custom "type" and the
"type()" counterpart. An explination of this fundamental would be greatly appreciated.
Thanks in advance and let me know if you need more information.
Thanks Jeremy









 

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    MasterVB.NET Forum Index -> Smart Device Application All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Archieve

Powered by phpBB © 2001, 2002 phpBB Group, used in Visual Basic 2005 .NET Forum

| Visual Basic .NET Forum | Online Recipe Archiver | Shareware Freeware PAD | Lowongan Kerja | Kamus Online | Health Supply | Digital Camera Review |
Orang Paling Keren

RSS