Google Spreadsheet API Changes

66 views Asked by At

We are using Spreadsheet API in our .Net Application to change content dynamically in the spreadsheet, and we are using that content to update values in the Google Ads with AdWords Script.

But from 1st June 2015 we are facing issues in our .Net Application, because of the update in the Spreadsheet API.

Our earlier work :- We were making window based application and scheduling it hourly. In the background it was retrieving and adding value in the spreadsheet. In the previous application, we used to authenticate our Gmail id and password only once in our code.

Below is the exact problem we are facing :-

As per the new API we need to authenticate our app each and every time it runs and also every time we need to put unique access code, which will badly affect our automation.

I would appreciate your immediate attention to this matter, and looking forward to your revert.

1

There are 1 answers

0
user3816325 On BEST ANSWER

After lot of R&D I got the solution.

Links: 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.

}