![]() |
VOOZH | about |
This article illustrates using LINQ to access tables within the Smartsheet via the CData ADO.NET Data Provider for Smartsheet. To achieve this, we will use LINQ to Entity Framework, which facilitates the generation of connections and can be seamlessly employed with any CData ADO.NET Data Providers to access data through LINQ.
CData provides the easiest way to access and integrate live data from Smartsheet. Customers use CData connectivity to:
Users frequently integrate Smartsheet with analytics tools such as Tableau, Crystal Reports, and Excel. Others leverage our tools to replicate Smartsheet data to databases or data warehouses.
See the help documentation for a guide to setting up an EF 6 project to use the provider.
Enter your data source connection information.
Smartsheet uses the OAuth authentication standard. To authenticate using OAuth, register an app to obtain the OAuthClientId, OAuthClientSecret, and CallbackURL connection properties.
However, for testing purposes you can instead use the Personal Access Token you get when you create an application; set this to the OAuthAccessToken connection property.
Below is a typical connection string:
OAuthClientId=MyOauthClientId;OAuthClientSecret=MyOAuthClientSecret;CallbackURL=http://localhost:33333;InitiateOAuth=GETANDREFRESH;
Using the entity you created, you can now perform select , update, delete, and insert commands. For example:
SmartsheetEntities context = new SmartsheetEntities();
var sheet_event_plan_budgetQuery = from sheet_event_plan_budget in context.Sheet_Event_Plan_Budget
select sheet_event_plan_budget;
foreach (var result in sheet_event_plan_budgetQuery) {
Console.WriteLine("{0} {1} ", result.Id, result.TaskName);
}
See "LINQ and Entity Framework" chapter in the help documentation for example queries of the supported LINQ.
Download a free trial of the Smartsheet Data Provider to get started:
Download NowLearn more:
👁 Smartsheet IconEasy-to-use Smartsheet client enables .NET-based applications to easily consume Smartsheet Sheets, Contacts, Folders, Groups, Users, etc.