المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : questions about an array?



C# Programming
09-19-2009, 04:11 AM
I know how to build a dynamic array and initilize the array. This is not my problem. That part of my code is working just fine and there is to much code to change the logic. So using the consepts of dynamic arrays... I run into a issue. I know it is simple but I can not find information about it.

The issue is this... If my sql statement returns to results the array is not built. Which cause the applciation to error. Is there a way with out throwing a lot of try catch's in my code to do something like


x = DynamicArray.Length

And if the array was not initialized for it to return a numeric value of -1 instead of it erroring saying the array is not initialized?