Simple .NET Integration With Google Spreadsheets
Simple .NET Integration With Google Spreadsheets
  • DataBind to Google Spreadsheets using standard Visual Studio wizards.
  • Comprehensive support for CRUD (Create, Read, Update, and Delete) operations.
  • Use Google Spreadsheets as a simple real-time database to power .NET applications.
Download Beta

The Google Spreadsheet Data Provider for ADO.NET offers the most natural way to access Google Spreadsheets data from any .NET application. Simply use Google Spreadsheet Data Provider objects to connect and access data just as you would access any traditional database. You will be able to use the Google Spreadsheet Data Provider through Visual Studio Server Explorer, in code through familiar classes, and in data controls like DataGridView, GridView, DataSet, etc.

Using the Google Spreadsheet Data Provider

The Google Spreadsheet Data Provider wraps the complexity of accessing Google Spreadsheets services in an easy-to-integrate, fully-managed ADO.NET Data Provider. Applications then access Google Spreadsheets through the Google Spreadsheet Data Provider with simple Transact-SQL.

 

The Google Spreadsheet Data Provider for ADO.NET hides the complexity of accessing data and provides additional powerful security features, smart caching, batching, socket management, and more.

Working with DataAdapters, DataSets, DataTables, etc.

The Google Spreadsheet Data Provider has the same ADO.NET architecture as the native .NET data providers for SQL Server and OLEDB including: Google SpreadsheetsConnection, Google SpreadsheetsCommand, Google SpreadsheetsDataAdapter, Google SpreadsheetsDataReader, Google SpreadsheetsDataSource, Google SpreadsheetsParameter, and Google SpreadsheetsTransaction. Because of this you can now access Google Spreadsheets data in an easy, familiar way.

For example:

using (GoogleSpreadsheetConnection conn = new GoogleSpreadsheetConnection("...")) {
	string select = "SELECT * FROM Customers_Sheet1";
	GoogleSpreadsheetCommand cmd = new GoogleSpreadsheetCommand(select, conn);
	GoogleSpreadsheetDataAdapter adapter = new GoogleSpreadsheetDataAdapter(cmd);
	using (adapter) {
		DataTable table = new DataTable();
		adapter.Fill(table);		
		...
	}
}

More Than Read-Only: Full Update/CRUD Support

Google Spreadsheet Data Provider goes beyond read-only functionality to deliver full support for Create, Read Update, and Delete operations (CRUD). Your end-users can interact with the data presented by the Google Spreadsheet Data Provider as easily as interacting with a database table.

using (GoogleSpreadsheetConnection connection = new GoogleSpreadsheetConnection(connectionString)) {
	GoogleSpreadsheetDataAdapter dataAdapter = new GoogleSpreadsheetDataAdapter(
	"SELECT Id, Where FROM Customers_Sheet1", connection);
  
	dataAdapter.UpdateCommand = new GoogleSpreadsheetCommand(
		"UPDATE Customers_Sheet1 SET Where = @Where " +
		"WHERE Id = @ID", connection);

	dataAdapter.UpdateCommand.Parameters.AddWithValue("@Where", "Where");
	dataAdapter.UpdateCommand.Parameters.AddWithValue("@Id", "80000173-1387137645");

	DataTable Customers_Sheet1Table = new DataTable();
	dataAdapter.Fill(Customers_Sheet1Table);

	DataRow firstrow = Customers_Sheet1Table.Rows[0];
	firstrow["Where"] = "New Location";

	dataAdapter.Update(Customers_Sheet1Table);
}