Custom Data Provider

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am converting my C application to .NET. I intend to make heavy use o
Windows Forms (and eventually XAML). I have a very simple but homegrow
"database" that consists of essentially flat files (with no relation
between the files). I would like to take advantage of the neat IDE feature
of .NET (forms) development (those that expose the column names) and th
inherent data binding methods by providing a .NET compatible interface to m
data (allowing access and update sort of automatically). I am reasonabl
comfortable with COM. Where should I look for information on whic
interfaces I must implement?. Is there sample code out there to lessen m
task
 
Jerry said:
I am converting my C application to .NET. I intend to make heavy use of
Windows Forms (and eventually XAML). I have a very simple but homegrown
"database" that consists of essentially flat files (with no relations
between the files). I would like to take advantage of the neat IDE features
of .NET (forms) development (those that expose the column names) and the
inherent data binding methods by providing a .NET compatible interface to my
data (allowing access and update sort of automatically). I am reasonably
comfortable with COM. Where should I look for information on which
interfaces I must implement?. Is there sample code out there to lessen my
task?

Short of developing a custom data provider (which is a fair amout of work),
you can just use DataSets.

You would just implement methods like

LoadDataTable(DataTable T, String FileName)
SaveDataTable(DataTable T, String FileName)

Then you have DataSets to bind to the UI, but your persistent storage will
still be your flat files.

David
 
I would have to agree that creating a custom data provider is quite a bit
of work. I created my own to see the technology. I created one to use the
file system and WMA file tags. There were about 4 classes that had to be
created and lots of methods to implement. At least VS 2003 did the creation
of the stubs for me.

Once done though it is great as all syntax for using it is the same as any
other data source. You would have to determine whether the developer can
create "select" criteria so that the methods implemented to read the data
can be restricted. This proved to be the hardest part. There is an article
in MSDN about this but since I did this months ago I no longer know exactly
where to look. I found it in google but I cannot remember exactly what
keywords were used.

Lloyd Sheen
 
Ok, I have implemented a sample .Net Framework Data Provider (one that I found in the MSDN library). I am able to connect to it using C# code. How can I get the Windows Forms designer to recognize the data source so that I can bind controls to the data?
 
Sorry did that in code.

Lloyd Sheen
Jerry said:
Ok, I have implemented a sample .Net Framework Data Provider (one that I
found in the MSDN library). I am able to connect to it using C# code. How
can I get the Windows Forms designer to recognize the data source so that I
can bind controls to the data?
 
Back
Top