Database not refreshing?

C

Cralis

I have run a query to populate a listview from a table.
Works fine.
I then add a new row to the table, and want to refresh the list view,
so I rerun my 'PopulateView' procedure I have created. But no new rows
appear!
I check the database, and the new row is there.
I close my app, reopen, and hey presto, the row appears.

Why am I unable to refresh the grid?

Code:

private void PopulateList()
{
lvModels.Items.Clear();
List<IModel> models =
ModelParts.classes.clsDOModels.getListOfModels(true);
for (int i = 0; i < models.Count; i++)
{
lvModels.Items.Add(models.description.ToString());
}
}
 
M

Mr. Arnold

Cralis said:
I have run a query to populate a listview from a table.
Works fine.
I then add a new row to the table, and want to refresh the list view,
so I rerun my 'PopulateView' procedure I have created. But no new rows
appear!
I check the database, and the new row is there.
I close my app, reopen, and hey presto, the row appears.

Why am I unable to refresh the grid?

Code:

private void PopulateList()
{
lvModels.Items.Clear();
List<IModel> models =
ModelParts.classes.clsDOModels.getListOfModels(true);
for (int i = 0; i < models.Count; i++)
{
lvModels.Items.Add(models.description.ToString());
}
}


Maybe, you need a lvModels.refresh at the end of the procedure.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top