Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm running two datasets right now. One is a large database of customers and related tables. Though it's relational in Access, I don't handle it as such in vb.net.

 

Often times I'm using dataview to filter, sort and bend the data to my will.

 

If you use dataviews for anything complex, you'll realize that you have to mind them very closely becuase playing with a DataView reflects its changes (filters, sorts) back to the datatable.

 

This means that if you had a listbox with customer names, then did a query using your DataView for an operation, you have to put it back to show everything when you're done (hopefully right away) or your listbox will reflect that query even though it's datasource is set directly to the DataTable! eek!

 

Now, I've done workarounds on my current project and I'm almost finished. I might extend this project further or work on similar projects, so I'm looking to run by some advice for someone who is a better .Net (oop) programmer than I.

 

I had the idea of creating a new class for each DataTable and one for the whole dataset by means of instantiating the individual classes.

 

Each DataTable/DataView class will allow me to filter/sort/etc, update, refresh and anything else I can think of needing.

 

This should allow me to use a datatable in muliple instances within the same form without each stepping on each other.

 

I also think this would be much better than the public module I currently hold for updating the database and sharing variables amongst multiple forms.

 

Any advice? Would this work? Better Ideas?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...