Question

I'm putting together a WinForms utility in c# which allows admins to query and perform actions (in bulk) on computers within my work environment. I've started to create a few mock projects to present to my superiors.

The utility displays a:

  1. list of computers in a datagridview (name, uptime, operating system, location, etc)
  2. list of actions/queries that can be performed on selected computers

The actions and queries will need to update rows in the Computer datagridview with their results. The user needs to be able to sort the columns in the datagridview and filter the rows based on computer locations.

My Computer's datagridview is populated as follows: Datagridview => BindingSource => DataSet => Local Database

When the Util is first run, the list of computers is read from an Active Directory group and inserted in to the Local Database. The computer's DataTable is then populated based on a query from the Database. The BindingSource is then bound to the DataTable and the datagridview is bound to the BindingSource to display to the user.

When an Action is run on a selection of computers, the results are added to the Computers Datatable (which is reflected in the Datagridview) and also commited to the SQLCEDatabase.

When a user selects a different location from a list of locations a SQL query is run to re-populate the datatable with the results from the local database.

The Util has no requirement to save any of the data that is collected, in fact, when the Util is first run it deletes all records from the local database and starts fresh.

I think I may have gone overkill with my design and would appreciate some advice on better a way to put it all together. Would I be better off scrapping the Local Database and keeping all the data in memory via a BindingList or other type of list? Would this still allow me to filter the datagridview based on queries and allow sorting?

Apologies if this post is long and convoluted, but I don't know how to put it any other way.

Was it helpful?

Solution

"when the Util is first run it deletes all records from the local database and starts fresh" => dump the database and keep everything in memory. Otherwise you add huge overhead, and get nothing useful in return.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top