• Hello and welcome to our new forums. We upgraded our forum sites to a more robust and modern system which we hope you will enjoy. Be sure to check out your profile by clicking the button on the top right and configure your preferences, signature, time zone, avatar, etc. as you wish. If you need help with using this new forum'ware try the help link on the bottom right.

    Click here to review your account now.

Question: Field Initializer Error

DataCarniv0r

New member
Joined
Apr 10, 2019
Messages
2
Programming Experience
Beginner
Hello, my lack of C# is keeping me from trying to consume data in an SDK. I'm getting the error: A field initializer cannot reference the non-static view, method, or property ' connection1.connector
on my last line of code with (connector) being underlined with this error. Help appreciated.

My code thus far.
Code with issues:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VersionOne.SDK.APIClient;


namespace VersionOneExtract3
{
    public class Connection1
    {
        V1Connector connector = V1Connector

    .WithInstanceUrl("https://www12.v1host.com/MySiteName")

    .WithUserAgentHeader("VersionOneExtract2", "1.0")

    .WithWindowsIntegrated("GA\\username", "password")

    .Build();

        IServices services = new Services(connector);
}
}
 
Top Bottom