google bigquery - Big Query InsertAll using C# -
i'm using code while trying insert data using big query. running without exceptions, table empty. problem code?
string service_account_email = "myaccount"; var certificate = new x509certificate2(@"xxx.p12", "notasecret", x509keystorageflags.exportable); serviceaccountcredential credential = new serviceaccountcredential( new serviceaccountcredential.initializer(service_account_email) { scopes = new[] { bigqueryservice.scope.bigqueryinsertdata, bigqueryservice.scope.bigquery } }.fromcertificate(certificate)); // create service. var service = new bigqueryservice(new baseclientservice.initializer() { httpclientinitializer = credential, applicationname = "test" }); google.apis.bigquery.v2.data.tabledatainsertallrequest tabreq = new google.apis.bigquery.v2.data.tabledatainsertallrequest(); list<google.apis.bigquery.v2.data.tabledatainsertallrequest.rowsdata> tabrows = new list<google.apis.bigquery.v2.data.tabledatainsertallrequest.rowsdata>(); google.apis.bigquery.v2.data.tabledatainsertallrequest.rowsdata rd = new google.apis.bigquery.v2.data.tabledatainsertallrequest.rowsdata(); idictionary<string, object> r = new dictionary<string, object>(); r.add("key", "value"); rd.json = r; tabrows.add(rd); tabreq.rows = tabrows; tabreq.kind = "bigquery#tabledatainsertallrequest"; service.tabledata.insertall(tabreq, "xxx", "xxx", "xxx");
Comments
Post a Comment