English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

in vb 8 or any smiler OO language

im port a name space then use it

--or using it directly--

ex ..

inpotrs system.data

....
dim ds as new dataset
or
dim ds as new data.dataset


with reasons

2007-02-20 06:25:47 · 2 answers · asked by Rami 5 in Computers & Internet Programming & Design

2 answers

A Reference to a VB.NET namespace is a requirement and must be added to a project before the objects in the namespace can be used. The Imports statement is not a requirement and is simply a coding convenience that allows shorter names to be used.

so according to above, if you use a lot of objects from system.data name space it will be more convinient to do the import.

Reason for choosing data.dataset instead of just dataset

what if you already have a class name dataset? the program won't know if you want to use your dataset or systems dataset..

2007-02-20 07:07:49 · answer #1 · answered by Zlavzilla 3 · 1 0

It's up to you, in VB.net it's easier to use the 'imports' statement to define namespaces you plan on using rather than typing the full name everytime. The only time you should ever type the full namespace is if you can't use the imports statement because it causes a naming conflict.

2007-02-20 15:11:40 · answer #2 · answered by Pfo 7 · 0 0

fedest.com, questions and answers