Associative arrays - and how to use them... wisely

· November 14, 2008

My questions in an earlier post was promptly answered by Mark A Williams in a great way.

So what he say pretty much confirms what I thought. Although associative arrays are great way to “bulk in” data to the database but when it comes to returning data the array-way might not always be right.

Since you have to allocate memory for the array and size of each element in the array the associative arrays are best suited for situations when you know the size of the data that is being returned. Not that often in my experience. In other cases you’ll better off with a plain old DataReader.

So now I know - thanks goes to Mark A Williams.

Twitter, Facebook