【问题标题】:sample VB.Net code for reading data from Big Query用于从 Big Query 读取数据的示例 VB.Net 代码
【发布时间】:2013-02-19 12:48:00
【问题描述】:

我需要使用 Google BigQuery API 查询 Google Big Query 表。我正在使用带有 VB.NET 的 Visual Studio 2012。我在 C# 中找到了一个示例代码,我可以通过使用 C# 在 Visual Studio 2012 中进行细微更改来使其工作。

参考:Google BigQuery with .NET documentation/ samples

我需要 VB.NET 中的代码,所以我将代码转换为 VB.Net,除了以下代码行之外,一切都可以正常编译。

// 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 为 VB.NET 中的代码提供错误“预期类型”。任何人都知道这行代码在 VB.NET 中的正确语法是什么?

【问题讨论】:

  • 您应该发布一些代码示例,并缩小您的答案范围。通常,本网站不欢迎诸如“给我看代码”或“为我写一些代码”之类的问题。表现出一些努力,你会得到回报! :)

标签: vb.net google-api-dotnet-client


【解决方案1】:

这与您的错误描述的完全一样。 VB.Net 不喜欢推断数组初始值设定项

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

应该是这样的

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-10-07
    • 1970-01-01
    • 2017-02-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多