I want to get Json data from Couchbase lite for the current test and express it in listview.
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show("Click");
var database = new Database("sync_test");
var collection = database.CreateCollection("sync", "test");
var scopeA = database.GetScope("test");
var collectionsInScopeA = scopeA.GetCollection("sync");
using (var query = QueryBuilder.Select(SelectResult.All())
.From(DataSource.Collection(collectionsInScopeA)))
{
var result = query.Execute();
var jsonString = JsonConvert.SerializeObject(result);
textBox6.Text = jsonString;
}
database.Close();
}
If you click the button, you can express it in textBox
I’m new to C#, so I’m asking how to express it in listview.
The json data currently represented in the textbox is as follows.
[[{"type":"Value1","owner":"Value2","createdAt":"2023-11-01T01:56:09.1816304+00:00"}],[{"type":"Value1","owner":"Value2","createdAt":"2023-11-01T02:09:04.2037492+00:00"}],[{"type":"Value1","owner":"Value2","createdAt":"2023-11-01T02:21:03.3849191+00:00"}],[{"type":"456","owner":"456","createdAt":"2023-11-01T06:48:21.6257854+00:00"}],[{"type":"Value1","owner":"Value2","createdAt":"2023-11-01T05:24:25.2305699+00:00"}],[{"type":"Value1","owner":"Value2","createdAt":"2023-11-01T05:24:58.7577975+00:00"}],[{"type":"Value1","owner":"Value2","createdAt":"2023-11-01T06:22:35.1119297+00:00"}],[{"type":"Value1","owner":"Value2","createdAt":"2023-11-01T06:27:25.5657207+00:00"}]]