Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Blazor CDataKintone ADO.NET Provider Sample
@page "/"
@using System.Data;
@using System.Data.CData.Kintone;
<h1>Hello, world!</h1>
Welcome to your new app.
<div class="row">
<div class="col-12">
@using (KintoneConnection connection = new KintoneConnection("URL=https://XXXXX.cybozu.com/;User=XXXXXX;Password=XXXXX;RTK=XXXXXX;"))
{
var sql = "SELECT * FROM [顧客リスト]";
var results = new DataTable();
KintoneDataAdapter dataAdapter = new KintoneDataAdapter(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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.