What is the best way

  • Thread starter Thread starter Dilton McGowan II
  • Start date Start date
D

Dilton McGowan II

I've found three different ways to read an (notice proper use if an) .NET
config file and display just a selected section in a DataGrid.

What is the recommended way?
 
Dilton:

That's a mighty vague question. 'best' in regards to data access has a lot
of factors. In general, I'd probably recommend binding the grid to a
DataView and from there, using the RowFilter property to control what's
shown or not. This can be set dynamically (from a control for instance) or
from a .config file.

If you could post a little more about the specific scenario you are
encountering, it'd probably help in determing what the options are.
 
Interesting side comment. Why would you say that "an" is the appropriate
indefinite article before .Net?

Dale
 
Dale,

Just trying some week-end humor, not necessarily with accuracy or
correctness. Apparently I hadn't yet had enough coffee.

Dilton
 
William,

Well there is no specific code issue here, I was looking for feedback from
people who have coded routines to read arbitrary sections from a .NET config
file and mapped it to a DataGrid. It was a query for techniques.

Are there any favorites out there, anyone? In my own code I've coded the
following approaches:

1) Use Configuration classes.
2) Read the XML contents into a DataSet then filter by using ImportRow on
the target DataSet then returning that DataSet.
3) This was really a morph of Item 1 and 2.

Option 2 is the one I like the best but I must admit that I expected that
when I set the schema for the DS and told it to read the config file; it
should map the sections appropriately. This approach fails if you have
multiple "<add " sections since the DS wants to treat these as proper
tables.

Thanks,
Dilton
 
You have to be careful about that. There are some (not me, I assure you)
who take themselves much too seriously around here. And I was hoping to
learn a new grammatical tidbit for my repertoire.

It's past coffee time. It's bed time.

Dale
 
Back
Top