![]() |
VOOZH | about |
Blazor is a framework for developing modern, client-side web UIs using .NET technology. Instead of coding in JavaScript, developers can use the familiar C# language and .NET libraries to build app UIs.
The CData ADO.NET Provider for Cvent can be used with standard ADO.NET interfaces, such as LINQ and Entity Framework, to interact with live Cvent data. Since Blazor supports .NET Core, developers can use CData ADO.NET Providers in Blazor apps. In this article, we will guide you to build a simple Blazor app that talks to Cvent using standard SQL queries.
CData ADO.NET Providers allow users to access Cvent just like they would access SQL Server, using simple SQL queries.
Install the Cvent ADO.NET Data Provider from the CData website or from NuGet. Search NuGet for "Cvent ADO.NET Data Provider."
๐ Install ADO.NET Cvent Provider from NuGet.Start by creating a Blazor project that references the CData ADO.NET Provider for Cvent
Before you can authenticate to Cvent, you must create a workspace and an OAuth application.
To create a workspace:
| event/attendees:read | event/attendees:write | event/contacts:read |
| event/contacts:write | event/custom-fields:read | event/custom-fields:write |
| event/events:read | event/events:write | event/sessions:delete |
| event/sessions:read | event/sessions:write | event/speakers:delete |
| event/speakers:read | event/speakers:write | budget/budget-items:read |
| budget/budget-items:write | exhibitor/exhibitors:read | exhibitor/exhibitors:write |
| survey/surveys:read | survey/surveys:write |
After you have set up a Workspace and invited them, developers can sign up and create a custom OAuth app. See the Creating a Custom OAuth Application section in the Help documentation for more information.
After creating an OAuth application, set the following connection properties to connect to Cvent:
For example: OAuthClientId=MyOAuthClientId;OAuthClientSecret=MyOAuthClientSecret;InitiateOAuth=GETANDREFRESH;
@page "/"
@using System.Data;
@using System.Data.CData.Cvent;
<h1>Hello, world!</h1>
Welcome to your Data app.
<div class="row">
<div class="col-12">
@using (CventConnection connection = new CventConnection(
"OAuthClientId=MyOAuthClientId;OAuthClientSecret=MyOAuthClientSecret;InitiateOAuth=GETANDREFRESH;"))
{
var sql = "SELECT Id, Title FROM Events WHERE Virtual = 'true'";
var results = new DataTable();
CventDataAdapter dataAdapter = new CventDataAdapter(sql, connection);
dataAdapter.Fill(results);
<table class="table table-bordered">
<thead class="thead-light">
<tr>
@foreach (DataColumn item in results.Rows[0].Table.Columns)
{
<th scope="col">@item.ColumnName</th>
}
</tr>
</thead>
<tbody>
@foreach (DataRow row in results.Rows)
{
<tr>
@foreach (var column in row.ItemArray)
{
<td>@column.ToString()</td>
}
</tr>
}
</tbody>
</table>
}
</div>
</div>
At this point, you have a Cvent-connected Blazor app, capable of working with live Cvent data just like you would work with a SQL Server instance. Download a free, 30-day trial and start working with live Cvent data in your Blazor apps today.
Download a free trial of the Cvent Data Provider to get started:
Download NowLearn more:
๐ Cvent IconRapidly create and deploy powerful .NET applications that integrate with Cvent.