Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I have a DataTable in my DataSet in which there is a column that serves as temporary storage for data. In order to put any kind of DataType in there (for ease of managability), I have made the column's DataType System.Object. Everything works great.....I can stick anything thing in there and retrieve it back into a it's specific data type without explicitly Casting. I assume that this is because all Data Types are derived from System.Object. I am concerned because generally in my development experience when something is this easy, you are paying the price somewhere. Could someone more experienced than I point out inefficiencies or a better way to do this? Thanks!
Posted
The Data Types will be 15% String 85% Double. The DataSet is only being used for an in-memory data cache. One DataSet worth of Data (8 tables) represents one Linear Programming Model's worth of data. I am using table #9 (the one discussed in this thread) to capture DataColumn changes (TableName, ColumnName, PrimaryKey, (Original value and Current Value - System.Object Types)) and give the user the option to reset them or submit them at different points in the app. I have my own updating, inserting, and deleting logic because of the nature of the LP Model. I want to use one table to capture changes so that I don't have to have 8 'Changes' tables for each representative Model Object (DataTable) in the Dataset.
  • *Experts*
Posted

I'd only point out that using extra columns can be a great benefit if that's really what you need. Since you're not saving this dataset to a database - internal cache only you said - then there's no network performance with passing this extra data around. If you really need to store the column so that you have the data PER ROW, then that's probably the best route to go. If your table only has one row for saving values, then maybe you want something else - either a custom object or even a Hashtable (both of which would be more lightweight memory-wise than a DataTable).

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

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...