RobEmDee Posted March 30, 2003 Posted March 30, 2003 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! Quote
*Gurus* Derek Stone Posted March 30, 2003 *Gurus* Posted March 30, 2003 All depends. What are the different data types that you're putting in there and how big are they if they're not standard types? How is this DataSet ultimately being used (an SQL insert/update possibly)? How many rows are there? Quote Posting Guidelines
RobEmDee Posted March 30, 2003 Author Posted March 30, 2003 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. Quote
*Experts* Nerseus Posted April 1, 2003 *Experts* Posted April 1, 2003 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 Quote "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
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.