B
bric
Every time that I sit down to use an array I wonder a bit about
syntax. Even if it's a simple thing and I can just do it quickly and
get it out of the way.
The reason I wonder is this. (Most often I'm coding vb)
dim sTest(3) as string
is fine for grabbing my 4 test items.
But I've also gotten into the habit of doing this:
dim arParm as sqlparameter() = new sqlparameter(3){}
So are they both 2 ways of doing the same thing? Intellisense doesn't
give errors when I type a string array in this same manner as used
with the sqlparm.
And I recently noticed that in C# you do this:
string[] sTest = new string[3];
.... is this the corrolary for the vb syntax used above in my arParm
example?
And why the curly brackets at the end of the line? Are they ever used
for anything?
I figured I better ask this before too many years pass and I retire
without learning the basics.
thanks
Brian
syntax. Even if it's a simple thing and I can just do it quickly and
get it out of the way.
The reason I wonder is this. (Most often I'm coding vb)
dim sTest(3) as string
is fine for grabbing my 4 test items.
But I've also gotten into the habit of doing this:
dim arParm as sqlparameter() = new sqlparameter(3){}
So are they both 2 ways of doing the same thing? Intellisense doesn't
give errors when I type a string array in this same manner as used
with the sqlparm.
And I recently noticed that in C# you do this:
string[] sTest = new string[3];
.... is this the corrolary for the vb syntax used above in my arParm
example?
And why the curly brackets at the end of the line? Are they ever used
for anything?
I figured I better ask this before too many years pass and I retire
without learning the basics.
thanks
Brian