【问题标题】:Google Spreadsheet API ChangesGoogle 电子表格 API 更改
【发布时间】:2015-06-16 10:12:57
【问题描述】:

我们在 .Net 应用程序中使用电子表格 API 来动态更改电子表格中的内容,并使用该内容通过 AdWords 脚本更新 Google Ads 中的值。

但从 2015 年 6 月 1 日起,由于电子表格 API 的更新,我们的 .Net 应用程序出现了问题。

我们早期的工作:- 我们正在制作基于窗口的应用程序并每小时安排一次。在后台,它在电子表格中检索和添加价值。在之前的应用程序中,我们过去只在代码中验证了一次 Gmail id 和密码。

以下是我们面临的确切问题:-

根据新的 API,我们需要在每次运行时验证我们的应用程序,并且每次我们需要放置唯一的访问代码时,这将严重影响我们的自动化。

感谢您立即关注此事,并期待您的回复。

【问题讨论】:

    标签: google-spreadsheet-api google-ads-api


    【解决方案1】:

    经过大量研发,我得到了解决方案。

    链接: https://developers.google.com/apps-script/guides/jdbc

    //it will insert value into table entries 
    function main() {
    
      // Replace the variables in this block with real values.
      var address = 'Your Server IP:1433';
    var user = 'Server username';
    var userPwd = Server Password';
    var db = 'lms';
    
      var dburl = 'jdbc:sqlserver://Your Server IP:1433;DataBaseName=lms';
    
    
    // Write one row of data to a table.
    
      var conn = Jdbc.getConnection(dburl, user, userPwd);
    Logger.log(conn);
      var stmt = conn.prepareStatement('INSERT INTO entries '
          + '(guestName, content) values (?, ?)');
      stmt.setString(1, 'First Guest');
      stmt.setString(2, 'Hello, world');
      stmt.execute();
    
    
    // Write 500 rows of data to a table in a single batch.
    
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-18
      • 2014-07-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多