0

I need to query Google Big Query table using Google BigQuery API. I am using Visual Studio 2012 with VB.NET. I found a sample code in C# and I could get it to work with a minor change in Visual Studio 2012 using C#.

Reference: Google BigQuery with .NET documentation/ samples

I need the code in VB.NET so I converted the code to VB.Net and everything compiles fine except the following line of code.

// Get the auth URL in C# that works fine:
            IAuthorizationState state = new AuthorizationState(new[] {  BigqueryService.Scopes.Bigquery.GetStringValue() });

    ' Get the auth URL in VB.NET that is giving an error “Type expected” :      
Dim state As IAuthorizationState = New AuthorizationState(New () {BigqueryService.Scopes.Bigquery.GetStringValue()})

Visual Studio give the error “Type expected” for the code in VB.NET. Anybody knows that what is the correct syntax in VB.NET for this line of code?

Community
  • 1
  • 1
  • You should post some code example, and narrow the scope of your answer. Usually questions like "show me the code" or "write some code for me" are not welcome on this site. Show some effort and you will be rewarded! :) – Lorenzo Dematté Feb 19 '13 at 13:05

1 Answers1

0

It's exactly as your error describes. VB.Net doesn't like inferred array initializers so

Dim state As IAuthorizationState = New AuthorizationState(New () {BigqueryService.S...

should be something like

Dim state As IAuthorizationState = New AuthorizationState(New TheTypeOfArrayHere() {BigqueryService.S...
hometoast
  • 11,522
  • 5
  • 41
  • 58