The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Why are typed data tables columns declared "internal"?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Roy Osherove

Posts: 1807
Nickname: royo
Registered: Sep, 2003

Roy Osherove is a .Net consultant based in Israel
Why are typed data tables columns declared "internal"? Posted: Nov 17, 2003 6:12 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Roy Osherove.
Original Post: Why are typed data tables columns declared "internal"?
Feed Title: ISerializable
Feed URL: http://www.asp.net/err404.htm?aspxerrorpath=/rosherove/Rss.aspx
Feed Description: Roy Osherove's persistent thoughts
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Roy Osherove
Latest Posts From ISerializable

Advertisement

Here's a question that Oskar Austegard left in response to what I wrote ,oh such a long time ago(6 months?), about typed datasets being scalable:

How exactly does one go about using a TDS effectively in a different project, given that the DataColumns are marked as internal?

Say I have the folowing solution with three projects:
MySol
* DAL
* Entities
* Web

If I create all my TDS in the Entities project, how will I be able to reference the DataColumn properties from within the DAL or Web project? This appears to me to be a major drawback of using TDS - at least as VS.NET generates them.

Thanks,

Oskar

My response:

Hi Oskar. These are declared internal because what you really want to use from external components are the "public" properties that each typed row exposes which are essentially the columns that you are looking for. For example, you should get a CustomersDatatable[rowindex].CustomerName if you want the value for the customer name column for a specific row. you can also get a “regular“ row by doing CustomersDatatable.Rows[rowindex] and casting it to a “CustomersDataRow“ object which will again provide you with all the properties you are looking for.

So why hide the columns themselves? I asked Mike Gunderloy and he came up with a reasonable explanation: To keep all that column access logic in one place (such as null return values and so on). Sounds reasonable to me..

 

Read: Why are typed data tables columns declared "internal"?

Topic: .NET Rocks! - PDC Edition Previous Topic   Next Topic Topic: Network Connections, or SneakerNet Evolved

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use