Larry Brister
asked on
Conversion from C# to VB inserting "Key" ???
In my following code (partial) the conversion adds "Key ."
Which gives me an error on code in VB.
How do I handle this?
THIS CODE
Produces THIS CODE
Which gives me an error on code in VB.
How do I handle this?
THIS CODE
using (SJVServiceClient client2 = new SJVServiceClient())
{
SearchResult res2 = new SearchResult();
res2 = client.GetResult(new GetResultRequest
{
RequestID = requestID,
Authentication = new Authentication
{ UserName = "username", Password = "password6" }
});
if (res2.ProductResult != null)
{
var json = JsonConvert.SerializeObject(res2);
lblJason.Text = json.ToString();
}
}
Produces THIS CODE
Using client2 As New SJVServiceClient()
Dim res2 As New SearchResult()
res2 = client.GetResult(New GetResultRequest() With { _
[b]Key [/b].RequestID = requestID, _
Key .Authentication = New Authentication() With { _
Key .UserName = "username", _
Key .Password = "password" _
} _
})
If res2.ProductResult IsNot Nothing Then
Dim json = JsonConvert.SerializeObject(res2)
lblJason.Text = json.ToString()
End If
End Using
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Found my own solution
Open in new window