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.
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);
}
}