473,390 Members | 1,301 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

which approach outperforms the other ?

Hi...

I have the following two excerpts from a method. It basically reads data
from a DataReader and
loads it in a collection.
Excerpt A:
********
With ProjectData
While .Read
Me.Add(DirectCast(.Item("project_id"), Guid), _
DirectCast(.Item("start_date"), DateTime), _
DirectCast(.Item("end_date"), DateTime), _
DirectCast(.Item("priority"), Integer), _
DirectCast(.Item("description"), String), _
DirectCast(.Item("project_manager"), String)
End While
End With


Excerpt B:
********
With ProjectData
While .Read
Me.Add(.Item("project_id"),
.Item("start_date"),
.Item("end_date"),
.Item("priority"),
.Item("description"),
.Item("project_manager")
End While
End With

Question:

Does automatic casting outperform explicit casting ? When I run ILDASM, I
find
that at each DirectCast, there is unboxing but in Excerpt B, there isn't
any.

Snippets of the ILDASM for Excerpt A and B below:

ILDASM (Excerpt A)
****************
IL_0098: ldloc.2
IL_0099: ldstr "description"
IL_009e: callvirt instance object
XXX.Projects.XDataReader::get_Item(string)
IL_00a3: unbox [mscorlib]System.Int32
IL_00a8: ldobj [mscorlib]System.Int32
ILDASM (Excerpt B)
****************
IL_0092: ldloc.2
IL_0093: ldstr "description"
IL_0098: callvirt instance object
XXX.Projects.XDataReader::get_Item(string)
IL_009d: call int32
[Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType ::F
romObject(object)

Any pointers to articles that explain what goes on "under the hood" with
regards to
casting would be much appreciated as well.

Cheers !
Nov 20 '05 #1
11 1349
This is mearly a guess at best...but I would like to learn this as well...

I would assume the direct cast would be faster (mainly because I know direct
cast is faster) and also this call

[Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType ::F
romObject(object)

I would figure that FromObject is a class and created on the heap. I would
also assume there is more code inside that method that takes longer to
execute. Whereas the unbox (I don't know what that means necessarily) seems
pretty direct. I don't know, just assuming.

I think it would be helpful to see the dissassembly from the FromObject
method to be 100% sure.

HTH,
CJ

"tinman" <dw****@yahoo.com> wrote in message
news:uh**************@TK2MSFTNGP12.phx.gbl...
Hi...

I have the following two excerpts from a method. It basically reads data
from a DataReader and
loads it in a collection.
Excerpt A:
********
With ProjectData
While .Read
Me.Add(DirectCast(.Item("project_id"), Guid), _
DirectCast(.Item("start_date"), DateTime), _
DirectCast(.Item("end_date"), DateTime), _
DirectCast(.Item("priority"), Integer), _
DirectCast(.Item("description"), String), _
DirectCast(.Item("project_manager"), String)
End While
End With


Excerpt B:
********
With ProjectData
While .Read
Me.Add(.Item("project_id"),
.Item("start_date"),
.Item("end_date"),
.Item("priority"),
.Item("description"),
.Item("project_manager")
End While
End With

Question:

Does automatic casting outperform explicit casting ? When I run ILDASM, I
find
that at each DirectCast, there is unboxing but in Excerpt B, there isn't
any.

Snippets of the ILDASM for Excerpt A and B below:

ILDASM (Excerpt A)
****************
IL_0098: ldloc.2
IL_0099: ldstr "description"
IL_009e: callvirt instance object
XXX.Projects.XDataReader::get_Item(string)
IL_00a3: unbox [mscorlib]System.Int32
IL_00a8: ldobj [mscorlib]System.Int32
ILDASM (Excerpt B)
****************
IL_0092: ldloc.2
IL_0093: ldstr "description"
IL_0098: callvirt instance object
XXX.Projects.XDataReader::get_Item(string)
IL_009d: call int32
[Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType ::F romObject(object)

Any pointers to articles that explain what goes on "under the hood" with
regards to
casting would be much appreciated as well.

Cheers !

Nov 20 '05 #2
Tinman,
In addition to the earlier answers William and I gave, the first is more
correct, although I would use the technique I gave in my first response here
instead of DirectCast.

Using Option Strict On, which requires the first, is more "correct", in that
you are stating that project_id is a GUID, start date is a DateTime... You
are not allowing the compiler make that decision for you...

Also using Option Strict On allows you to catch a number of errors at
compile time, instead of run time.

Hope this helps
Jay

"tinman" <dw****@yahoo.com> wrote in message
news:uh**************@TK2MSFTNGP12.phx.gbl...
Hi...

I have the following two excerpts from a method. It basically reads data
from a DataReader and
loads it in a collection.
Excerpt A:
********
With ProjectData
While .Read
Me.Add(DirectCast(.Item("project_id"), Guid), _
DirectCast(.Item("start_date"), DateTime), _
DirectCast(.Item("end_date"), DateTime), _
DirectCast(.Item("priority"), Integer), _
DirectCast(.Item("description"), String), _
DirectCast(.Item("project_manager"), String)
End While
End With


Excerpt B:
********
With ProjectData
While .Read
Me.Add(.Item("project_id"),
.Item("start_date"),
.Item("end_date"),
.Item("priority"),
.Item("description"),
.Item("project_manager")
End While
End With

Question:

Does automatic casting outperform explicit casting ? When I run ILDASM, I
find
that at each DirectCast, there is unboxing but in Excerpt B, there isn't
any.

Snippets of the ILDASM for Excerpt A and B below:

ILDASM (Excerpt A)
****************
IL_0098: ldloc.2
IL_0099: ldstr "description"
IL_009e: callvirt instance object
XXX.Projects.XDataReader::get_Item(string)
IL_00a3: unbox [mscorlib]System.Int32
IL_00a8: ldobj [mscorlib]System.Int32
ILDASM (Excerpt B)
****************
IL_0092: ldloc.2
IL_0093: ldstr "description"
IL_0098: callvirt instance object
XXX.Projects.XDataReader::get_Item(string)
IL_009d: call int32
[Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType ::F romObject(object)

Any pointers to articles that explain what goes on "under the hood" with
regards to
casting would be much appreciated as well.

Cheers !

Nov 20 '05 #3
thanks guys....

I believe the Get*Type* works better than the DirectCast approach. The
resulting
IL appears "leaner"...

In the initial IL with DirectCast, I was afraid that all the unboxing would
cause a performance
concern since it was going to continue reading data in a loop (While .Read)
........

Cheers...
"tinman" <dw****@yahoo.com> wrote in message
news:uh**************@TK2MSFTNGP12.phx.gbl...
Hi...

I have the following two excerpts from a method. It basically reads data
from a DataReader and
loads it in a collection.
Excerpt A:
********
With ProjectData
While .Read
Me.Add(DirectCast(.Item("project_id"), Guid), _
DirectCast(.Item("start_date"), DateTime), _
DirectCast(.Item("end_date"), DateTime), _
DirectCast(.Item("priority"), Integer), _
DirectCast(.Item("description"), String), _
DirectCast(.Item("project_manager"), String)
End While
End With


Excerpt B:
********
With ProjectData
While .Read
Me.Add(.Item("project_id"),
.Item("start_date"),
.Item("end_date"),
.Item("priority"),
.Item("description"),
.Item("project_manager")
End While
End With

Question:

Does automatic casting outperform explicit casting ? When I run ILDASM, I
find
that at each DirectCast, there is unboxing but in Excerpt B, there isn't
any.

Snippets of the ILDASM for Excerpt A and B below:

ILDASM (Excerpt A)
****************
IL_0098: ldloc.2
IL_0099: ldstr "description"
IL_009e: callvirt instance object
XXX.Projects.XDataReader::get_Item(string)
IL_00a3: unbox [mscorlib]System.Int32
IL_00a8: ldobj [mscorlib]System.Int32
ILDASM (Excerpt B)
****************
IL_0092: ldloc.2
IL_0093: ldstr "description"
IL_0098: callvirt instance object
XXX.Projects.XDataReader::get_Item(string)
IL_009d: call int32
[Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType ::F romObject(object)

Any pointers to articles that explain what goes on "under the hood" with
regards to
casting would be much appreciated as well.

Cheers !

Nov 20 '05 #4
Alright, maybe this is a dumb question, but what is unboxing?
"tinman" <dw****@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
thanks guys....

I believe the Get*Type* works better than the DirectCast approach. The
resulting
IL appears "leaner"...

In the initial IL with DirectCast, I was afraid that all the unboxing would cause a performance
concern since it was going to continue reading data in a loop (While ..Read) .......

Cheers...
"tinman" <dw****@yahoo.com> wrote in message
news:uh**************@TK2MSFTNGP12.phx.gbl...
Hi...

I have the following two excerpts from a method. It basically reads data
from a DataReader and
loads it in a collection.
Excerpt A:
********
With ProjectData
While .Read
Me.Add(DirectCast(.Item("project_id"), Guid), _
DirectCast(.Item("start_date"), DateTime), _
DirectCast(.Item("end_date"), DateTime), _
DirectCast(.Item("priority"), Integer), _
DirectCast(.Item("description"), String), _
DirectCast(.Item("project_manager"), String)
End While
End With


Excerpt B:
********
With ProjectData
While .Read
Me.Add(.Item("project_id"),
.Item("start_date"),
.Item("end_date"),
.Item("priority"),
.Item("description"),
.Item("project_manager")
End While
End With

Question:

Does automatic casting outperform explicit casting ? When I run ILDASM, I find
that at each DirectCast, there is unboxing but in Excerpt B, there isn't
any.

Snippets of the ILDASM for Excerpt A and B below:

ILDASM (Excerpt A)
****************
IL_0098: ldloc.2
IL_0099: ldstr "description"
IL_009e: callvirt instance object
XXX.Projects.XDataReader::get_Item(string)
IL_00a3: unbox [mscorlib]System.Int32
IL_00a8: ldobj [mscorlib]System.Int32
ILDASM (Excerpt B)
****************
IL_0092: ldloc.2
IL_0093: ldstr "description"
IL_0098: callvirt instance object
XXX.Projects.XDataReader::get_Item(string)
IL_009d: call int32

[Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType ::F
romObject(object)

Any pointers to articles that explain what goes on "under the hood" with
regards to
casting would be much appreciated as well.

Cheers !


Nov 20 '05 #5
CJ,
When you assign a value type to an Object variable that type is boxed. Which
copies the value of the value type to an object on the heap.

When you then assign this Object variable back to the value type variable,
the object is unboxed.

Dim i As Integer
i = 100
Dim o As Object
o = i ' this causes the 100 to be boxed.

i = o ' this causes the boxed 100 to be unboxed

Of course if you have Option Strict On, you need DirectCast

i = DirectCast(o, Integer)

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:Op****************@TK2MSFTNGP09.phx.gbl...
Alright, maybe this is a dumb question, but what is unboxing?
"tinman" <dw****@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
thanks guys....

I believe the Get*Type* works better than the DirectCast approach. The
resulting
IL appears "leaner"...

In the initial IL with DirectCast, I was afraid that all the unboxing would
cause a performance
concern since it was going to continue reading data in a loop (While

.Read)
.......

Cheers...
"tinman" <dw****@yahoo.com> wrote in message
news:uh**************@TK2MSFTNGP12.phx.gbl...
Hi...

I have the following two excerpts from a method. It basically reads data from a DataReader and
loads it in a collection.
Excerpt A:
********
With ProjectData
While .Read
Me.Add(DirectCast(.Item("project_id"), Guid), _
DirectCast(.Item("start_date"), DateTime), _ DirectCast(.Item("end_date"), DateTime), _
DirectCast(.Item("priority"), Integer), _
DirectCast(.Item("description"), String), _
DirectCast(.Item("project_manager"), String) End While
End With


Excerpt B:
********
With ProjectData
While .Read
Me.Add(.Item("project_id"),
.Item("start_date"),
.Item("end_date"),
.Item("priority"),
.Item("description"),
.Item("project_manager")
End While
End With

Question:

Does automatic casting outperform explicit casting ? When I run ILDASM, I
find
that at each DirectCast, there is unboxing but in Excerpt B, there
isn't any.

Snippets of the ILDASM for Excerpt A and B below:

ILDASM (Excerpt A)
****************
IL_0098: ldloc.2
IL_0099: ldstr "description"
IL_009e: callvirt instance object
XXX.Projects.XDataReader::get_Item(string)
IL_00a3: unbox [mscorlib]System.Int32
IL_00a8: ldobj [mscorlib]System.Int32
ILDASM (Excerpt B)
****************
IL_0092: ldloc.2
IL_0093: ldstr "description"
IL_0098: callvirt instance object
XXX.Projects.XDataReader::get_Item(string)
IL_009d: call int32

[Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType ::F
romObject(object)

Any pointers to articles that explain what goes on "under the hood" with regards to
casting would be much appreciated as well.

Cheers !



Nov 20 '05 #6
Helps tremendously. Thanks for the info on that one Jay.

I think the best way to see it "visually" would be when your watching a
variable (in the watch window) of a base type (i.e. DataRow) thats actually
inherited (i.e MyDataRow of a dataset)

Where it shows your +- graphic and says its a datarow, then there is a sub
type underneath it that tells the actual class type that it is.

I hope that made sense. But again I appreciate your explanation.

So is unboxing an expensive process? given its only a single line of IL but
was curious if it was or not.


"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:OL**************@TK2MSFTNGP10.phx.gbl...
CJ,
When you assign a value type to an Object variable that type is boxed. Which copies the value of the value type to an object on the heap.

When you then assign this Object variable back to the value type variable,
the object is unboxed.

Dim i As Integer
i = 100
Dim o As Object
o = i ' this causes the 100 to be boxed.

i = o ' this causes the boxed 100 to be unboxed

Of course if you have Option Strict On, you need DirectCast

i = DirectCast(o, Integer)

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:Op****************@TK2MSFTNGP09.phx.gbl...
Alright, maybe this is a dumb question, but what is unboxing?
"tinman" <dw****@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
thanks guys....

I believe the Get*Type* works better than the DirectCast approach. The
resulting
IL appears "leaner"...

In the initial IL with DirectCast, I was afraid that all the unboxing would
cause a performance
concern since it was going to continue reading data in a loop (While

.Read)
.......

Cheers...
"tinman" <dw****@yahoo.com> wrote in message
news:uh**************@TK2MSFTNGP12.phx.gbl...
> Hi...
>
> I have the following two excerpts from a method. It basically reads data > from a DataReader and
> loads it in a collection.
>
>
> Excerpt A:
> ********
> With ProjectData
> While .Read
> Me.Add(DirectCast(.Item("project_id"), Guid), _
> DirectCast(.Item("start_date"), DateTime), _
> DirectCast(.Item("end_date"), DateTime),
_ > DirectCast(.Item("priority"), Integer), _
> DirectCast(.Item("description"), String), _ > DirectCast(.Item("project_manager"),

String) > End While
> End With
>
>
>
>
> Excerpt B:
> ********
> With ProjectData
> While .Read
> Me.Add(.Item("project_id"),
> .Item("start_date"),
> .Item("end_date"),
> .Item("priority"),
> .Item("description"),
> .Item("project_manager")
> End While
> End With
>
>
>
> Question:
>
> Does automatic casting outperform explicit casting ? When I run ILDASM,
I
> find
> that at each DirectCast, there is unboxing but in Excerpt B, there

isn't > any.
>
> Snippets of the ILDASM for Excerpt A and B below:
>
> ILDASM (Excerpt A)
> ****************
> IL_0098: ldloc.2
> IL_0099: ldstr "description"
> IL_009e: callvirt instance object
> XXX.Projects.XDataReader::get_Item(string)
> IL_00a3: unbox [mscorlib]System.Int32
> IL_00a8: ldobj [mscorlib]System.Int32
>
>
> ILDASM (Excerpt B)
> ****************
> IL_0092: ldloc.2
> IL_0093: ldstr "description"
> IL_0098: callvirt instance object
> XXX.Projects.XDataReader::get_Item(string)
> IL_009d: call int32
>

[Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType ::F
> romObject(object)
>
> Any pointers to articles that explain what goes on "under the hood" with > regards to
> casting would be much appreciated as well.
>
> Cheers !
>
>



Nov 20 '05 #7
CJ,
So is unboxing an expensive process? given its only a single line of IL but was curious if it was or not. Its expensive in that the value needs to be copied from the heap to the
variable.

Its also expensive in that the boxing itself created an object on the heap,
this object will later need to be Garbage collected.

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl... Helps tremendously. Thanks for the info on that one Jay.

I think the best way to see it "visually" would be when your watching a
variable (in the watch window) of a base type (i.e. DataRow) thats actually inherited (i.e MyDataRow of a dataset)

Where it shows your +- graphic and says its a datarow, then there is a sub
type underneath it that tells the actual class type that it is.

I hope that made sense. But again I appreciate your explanation.

So is unboxing an expensive process? given its only a single line of IL but was curious if it was or not.


"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:OL**************@TK2MSFTNGP10.phx.gbl...
CJ,
When you assign a value type to an Object variable that type is boxed. Which
copies the value of the value type to an object on the heap.

When you then assign this Object variable back to the value type variable,
the object is unboxed.

Dim i As Integer
i = 100
Dim o As Object
o = i ' this causes the 100 to be boxed.

i = o ' this causes the boxed 100 to be unboxed

Of course if you have Option Strict On, you need DirectCast

i = DirectCast(o, Integer)

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:Op****************@TK2MSFTNGP09.phx.gbl...
Alright, maybe this is a dumb question, but what is unboxing?
"tinman" <dw****@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
> thanks guys....
>
> I believe the Get*Type* works better than the DirectCast approach. The > resulting
> IL appears "leaner"...
>
> In the initial IL with DirectCast, I was afraid that all the unboxing would
> cause a performance
> concern since it was going to continue reading data in a loop (While
.Read)
> .......
>
> Cheers...
>
>
> "tinman" <dw****@yahoo.com> wrote in message
> news:uh**************@TK2MSFTNGP12.phx.gbl...
> > Hi...
> >
> > I have the following two excerpts from a method. It basically reads
data
> > from a DataReader and
> > loads it in a collection.
> >
> >
> > Excerpt A:
> > ********
> > With ProjectData
> > While .Read
> > Me.Add(DirectCast(.Item("project_id"), Guid), _
> > DirectCast(.Item("start_date"), DateTime),
_
> > DirectCast(.Item("end_date"),

DateTime), _ > > DirectCast(.Item("priority"), Integer),
_ > > DirectCast(.Item("description"), String),
_ > > DirectCast(.Item("project_manager"),

String)
> > End While
> > End With
> >
> >
> >
> >
> > Excerpt B:
> > ********
> > With ProjectData
> > While .Read
> > Me.Add(.Item("project_id"),
> > .Item("start_date"),
> > .Item("end_date"),
> > .Item("priority"),
> > .Item("description"),
> > .Item("project_manager")
> > End While
> > End With
> >
> >
> >
> > Question:
> >
> > Does automatic casting outperform explicit casting ? When I run

ILDASM,
I
> > find
> > that at each DirectCast, there is unboxing but in Excerpt B, there

isn't
> > any.
> >
> > Snippets of the ILDASM for Excerpt A and B below:
> >
> > ILDASM (Excerpt A)
> > ****************
> > IL_0098: ldloc.2
> > IL_0099: ldstr "description"
> > IL_009e: callvirt instance object
> > XXX.Projects.XDataReader::get_Item(string)
> > IL_00a3: unbox [mscorlib]System.Int32
> > IL_00a8: ldobj [mscorlib]System.Int32
> >
> >
> > ILDASM (Excerpt B)
> > ****************
> > IL_0092: ldloc.2
> > IL_0093: ldstr "description"
> > IL_0098: callvirt instance object
> > XXX.Projects.XDataReader::get_Item(string)
> > IL_009d: call int32
> >
>

[Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType ::F > > romObject(object)
> >
> > Any pointers to articles that explain what goes on "under the

hood" with
> > regards to
> > casting would be much appreciated as well.
> >
> > Cheers !
> >
> >
>
>



Nov 20 '05 #8
Ok, last question I swear.

Alright, so unboxing takes a variable (more than likely on the heap in most
cases) and creates a copy of that on the heap again on the unboxing process.
And then has to be gc'd as well as the original value (if that original
value exists on the heap as well).

Hmmm...

Option Strict. =)

Thanks Jay!

-CJ

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
CJ,
So is unboxing an expensive process? given its only a single line of IL but
was curious if it was or not.

Its expensive in that the value needs to be copied from the heap to the
variable.

Its also expensive in that the boxing itself created an object on the

heap, this object will later need to be Garbage collected.

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Helps tremendously. Thanks for the info on that one Jay.

I think the best way to see it "visually" would be when your watching a
variable (in the watch window) of a base type (i.e. DataRow) thats actually
inherited (i.e MyDataRow of a dataset)

Where it shows your +- graphic and says its a datarow, then there is a sub
type underneath it that tells the actual class type that it is.

I hope that made sense. But again I appreciate your explanation.

So is unboxing an expensive process? given its only a single line of IL

but
was curious if it was or not.


"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message news:OL**************@TK2MSFTNGP10.phx.gbl...
CJ,
When you assign a value type to an Object variable that type is boxed.

Which
copies the value of the value type to an object on the heap.

When you then assign this Object variable back to the value type

variable, the object is unboxed.

Dim i As Integer
i = 100
Dim o As Object
o = i ' this causes the 100 to be boxed.

i = o ' this causes the boxed 100 to be unboxed

Of course if you have Option Strict On, you need DirectCast

i = DirectCast(o, Integer)

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:Op****************@TK2MSFTNGP09.phx.gbl...
> Alright, maybe this is a dumb question, but what is unboxing?
>
>
> "tinman" <dw****@yahoo.com> wrote in message
> news:%2****************@TK2MSFTNGP09.phx.gbl...
> > thanks guys....
> >
> > I believe the Get*Type* works better than the DirectCast approach. The > > resulting
> > IL appears "leaner"...
> >
> > In the initial IL with DirectCast, I was afraid that all the unboxing > would
> > cause a performance
> > concern since it was going to continue reading data in a loop (While > .Read)
> > .......
> >
> > Cheers...
> >
> >
> > "tinman" <dw****@yahoo.com> wrote in message
> > news:uh**************@TK2MSFTNGP12.phx.gbl...
> > > Hi...
> > >
> > > I have the following two excerpts from a method. It basically reads data
> > > from a DataReader and
> > > loads it in a collection.
> > >
> > >
> > > Excerpt A:
> > > ********
> > > With ProjectData
> > > While .Read
> > > Me.Add(DirectCast(.Item("project_id"), Guid), _
> > > DirectCast(.Item("start_date"),

DateTime),
_
> > > DirectCast(.Item("end_date"), DateTime),
_
> > > DirectCast(.Item("priority"), Integer), _ > > > DirectCast(.Item("description"), String),
_
> > > DirectCast(.Item("project_manager"),
String)
> > > End While
> > > End With
> > >
> > >
> > >
> > >
> > > Excerpt B:
> > > ********
> > > With ProjectData
> > > While .Read
> > > Me.Add(.Item("project_id"),
> > > .Item("start_date"),
> > > .Item("end_date"),
> > > .Item("priority"),
> > > .Item("description"),
> > > .Item("project_manager")
> > > End While
> > > End With
> > >
> > >
> > >
> > > Question:
> > >
> > > Does automatic casting outperform explicit casting ? When I run
ILDASM,
> I
> > > find
> > > that at each DirectCast, there is unboxing but in Excerpt B,

there isn't
> > > any.
> > >
> > > Snippets of the ILDASM for Excerpt A and B below:
> > >
> > > ILDASM (Excerpt A)
> > > ****************
> > > IL_0098: ldloc.2
> > > IL_0099: ldstr "description"
> > > IL_009e: callvirt instance object
> > > XXX.Projects.XDataReader::get_Item(string)
> > > IL_00a3: unbox [mscorlib]System.Int32
> > > IL_00a8: ldobj [mscorlib]System.Int32
> > >
> > >
> > > ILDASM (Excerpt B)
> > > ****************
> > > IL_0092: ldloc.2
> > > IL_0093: ldstr "description"
> > > IL_0098: callvirt instance object
> > > XXX.Projects.XDataReader::get_Item(string)
> > > IL_009d: call int32
> > >
> >
>

[Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType ::F
> > > romObject(object)
> > >
> > > Any pointers to articles that explain what goes on "under the hood" with
> > > regards to
> > > casting would be much appreciated as well.
> > >
> > > Cheers !
> > >
> > >
> >
> >
>
>



Nov 20 '05 #9
CJ,
Alright, so unboxing takes a variable (more than likely on the heap in most cases) By definition a boxed value is on the heap.
cases) and creates a copy of that on the heap again on the unboxing process.
No, not quite. Unboxing creates a copy of that value on the stack.
And then has to be gc'd as well as the original value (if that original
value exists on the heap as well). Correct the object that was created when the original value was boxed will
need to GC'd...

If you following the above, remember that a regular reference type (a Class)
can contain value types also, these values can also be boxed & unboxed,
however explaining it is a little more confusing ;-)

Option Strict has no real effect on Boxing & Unboxing.

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:uv****************@TK2MSFTNGP11.phx.gbl... Ok, last question I swear.

Alright, so unboxing takes a variable (more than likely on the heap in most cases) and creates a copy of that on the heap again on the unboxing process. And then has to be gc'd as well as the original value (if that original
value exists on the heap as well).

Hmmm...

Option Strict. =)

Thanks Jay!

-CJ

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
CJ,
So is unboxing an expensive process? given its only a single line of IL
but
was curious if it was or not.

Its expensive in that the value needs to be copied from the heap to the
variable.

Its also expensive in that the boxing itself created an object on the

heap,
this object will later need to be Garbage collected.

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Helps tremendously. Thanks for the info on that one Jay.

I think the best way to see it "visually" would be when your watching
a variable (in the watch window) of a base type (i.e. DataRow) thats

actually
inherited (i.e MyDataRow of a dataset)

Where it shows your +- graphic and says its a datarow, then there is a sub type underneath it that tells the actual class type that it is.

I hope that made sense. But again I appreciate your explanation.

So is unboxing an expensive process? given its only a single line of IL but
was curious if it was or not.


"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message news:OL**************@TK2MSFTNGP10.phx.gbl...
> CJ,
> When you assign a value type to an Object variable that type is
boxed. Which
> copies the value of the value type to an object on the heap.
>
> When you then assign this Object variable back to the value type

variable,
> the object is unboxed.
>
> Dim i As Integer
> i = 100
> Dim o As Object
> o = i ' this causes the 100 to be boxed.
>
> i = o ' this causes the boxed 100 to be unboxed
>
> Of course if you have Option Strict On, you need DirectCast
>
> i = DirectCast(o, Integer)
>
> Hope this helps
> Jay
>
> "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> news:Op****************@TK2MSFTNGP09.phx.gbl...
> > Alright, maybe this is a dumb question, but what is unboxing?
> >
> >
> > "tinman" <dw****@yahoo.com> wrote in message
> > news:%2****************@TK2MSFTNGP09.phx.gbl...
> > > thanks guys....
> > >
> > > I believe the Get*Type* works better than the DirectCast approach.
The
> > > resulting
> > > IL appears "leaner"...
> > >
> > > In the initial IL with DirectCast, I was afraid that all the

unboxing
> > would
> > > cause a performance
> > > concern since it was going to continue reading data in a loop

(While > > .Read)
> > > .......
> > >
> > > Cheers...
> > >
> > >
> > > "tinman" <dw****@yahoo.com> wrote in message
> > > news:uh**************@TK2MSFTNGP12.phx.gbl...
> > > > Hi...
> > > >
> > > > I have the following two excerpts from a method. It basically

reads
> data
> > > > from a DataReader and
> > > > loads it in a collection.
> > > >
> > > >
> > > > Excerpt A:
> > > > ********
> > > > With ProjectData
> > > > While .Read
> > > > Me.Add(DirectCast(.Item("project_id"), Guid), _
> > > > DirectCast(.Item("start_date"),
DateTime),
> _
> > > > DirectCast(.Item("end_date"),

DateTime),
_
> > > > DirectCast(.Item("priority"), Integer),
_
> > > > DirectCast(.Item("description"),

String),
_
> > > >

DirectCast(.Item("project_manager"), > String)
> > > > End While
> > > > End With
> > > >
> > > >
> > > >
> > > >
> > > > Excerpt B:
> > > > ********
> > > > With ProjectData
> > > > While .Read
> > > > Me.Add(.Item("project_id"),
> > > > .Item("start_date"),
> > > > .Item("end_date"),
> > > > .Item("priority"),
> > > > .Item("description"),
> > > > .Item("project_manager")
> > > > End While
> > > > End With
> > > >
> > > >
> > > >
> > > > Question:
> > > >
> > > > Does automatic casting outperform explicit casting ? When I run > ILDASM,
> > I
> > > > find
> > > > that at each DirectCast, there is unboxing but in Excerpt B,

there > isn't
> > > > any.
> > > >
> > > > Snippets of the ILDASM for Excerpt A and B below:
> > > >
> > > > ILDASM (Excerpt A)
> > > > ****************
> > > > IL_0098: ldloc.2
> > > > IL_0099: ldstr "description"
> > > > IL_009e: callvirt instance object
> > > > XXX.Projects.XDataReader::get_Item(string)
> > > > IL_00a3: unbox [mscorlib]System.Int32
> > > > IL_00a8: ldobj [mscorlib]System.Int32
> > > >
> > > >
> > > > ILDASM (Excerpt B)
> > > > ****************
> > > > IL_0092: ldloc.2
> > > > IL_0093: ldstr "description"
> > > > IL_0098: callvirt instance object
> > > > XXX.Projects.XDataReader::get_Item(string)
> > > > IL_009d: call int32
> > > >
> > >
> >
>

[Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType ::F
> > > > romObject(object)
> > > >
> > > > Any pointers to articles that explain what goes on "under the

hood"
> with
> > > > regards to
> > > > casting would be much appreciated as well.
> > > >
> > > > Cheers !
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #10

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:O7*************@TK2MSFTNGP11.phx.gbl...
CJ,
Alright, so unboxing takes a variable (more than likely on the heap in most
cases)

By definition a boxed value is on the heap.
cases) and creates a copy of that on the heap again on the unboxing

process.
No, not quite. Unboxing creates a copy of that value on the stack.


Ahhh.. ok that makes sense.
And then has to be gc'd as well as the original value (if that original
value exists on the heap as well).

Correct the object that was created when the original value was boxed will
need to GC'd...

If you following the above, remember that a regular reference type (a

Class) can contain value types also, these values can also be boxed & unboxed,
however explaining it is a little more confusing ;-)

Yeah I remember that. Thats why I was curiuos about that because I read
that value types that exist within a reference type (class) will be created
on the heap as well. Only direct value types (if that makes sense) will be
created on the stack (like locals and any variables pertinant to the current
scope.)
Option Strict has no real effect on Boxing & Unboxing.

I was making a joke. poorly. =)

Thanks again for your help.
Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:uv****************@TK2MSFTNGP11.phx.gbl...
Ok, last question I swear.

Alright, so unboxing takes a variable (more than likely on the heap in most
cases) and creates a copy of that on the heap again on the unboxing

process.
And then has to be gc'd as well as the original value (if that original
value exists on the heap as well).

Hmmm...

Option Strict. =)

Thanks Jay!

-CJ

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
CJ,
> So is unboxing an expensive process? given its only a single line of IL but
> was curious if it was or not.
Its expensive in that the value needs to be copied from the heap to
the variable.

Its also expensive in that the boxing itself created an object on the heap,
this object will later need to be Garbage collected.

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
> Helps tremendously. Thanks for the info on that one Jay.
>
> I think the best way to see it "visually" would be when your watching a > variable (in the watch window) of a base type (i.e. DataRow) thats
actually
> inherited (i.e MyDataRow of a dataset)
>
> Where it shows your +- graphic and says its a datarow, then there is
a
sub
> type underneath it that tells the actual class type that it is.
>
> I hope that made sense. But again I appreciate your explanation.
>
> So is unboxing an expensive process? given its only a single line
of IL but
> was curious if it was or not.
>
>
>
>
> "Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in

message
> news:OL**************@TK2MSFTNGP10.phx.gbl...
> > CJ,
> > When you assign a value type to an Object variable that type is boxed. > Which
> > copies the value of the value type to an object on the heap.
> >
> > When you then assign this Object variable back to the value type
variable,
> > the object is unboxed.
> >
> > Dim i As Integer
> > i = 100
> > Dim o As Object
> > o = i ' this causes the 100 to be boxed.
> >
> > i = o ' this causes the boxed 100 to be unboxed
> >
> > Of course if you have Option Strict On, you need DirectCast
> >
> > i = DirectCast(o, Integer)
> >
> > Hope this helps
> > Jay
> >
> > "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> > news:Op****************@TK2MSFTNGP09.phx.gbl...
> > > Alright, maybe this is a dumb question, but what is unboxing?
> > >
> > >
> > > "tinman" <dw****@yahoo.com> wrote in message
> > > news:%2****************@TK2MSFTNGP09.phx.gbl...
> > > > thanks guys....
> > > >
> > > > I believe the Get*Type* works better than the DirectCast approach. The
> > > > resulting
> > > > IL appears "leaner"...
> > > >
> > > > In the initial IL with DirectCast, I was afraid that all the
unboxing
> > > would
> > > > cause a performance
> > > > concern since it was going to continue reading data in a loop

(While
> > > .Read)
> > > > .......
> > > >
> > > > Cheers...
> > > >
> > > >
> > > > "tinman" <dw****@yahoo.com> wrote in message
> > > > news:uh**************@TK2MSFTNGP12.phx.gbl...
> > > > > Hi...
> > > > >
> > > > > I have the following two excerpts from a method. It
basically reads
> > data
> > > > > from a DataReader and
> > > > > loads it in a collection.
> > > > >
> > > > >
> > > > > Excerpt A:
> > > > > ********
> > > > > With ProjectData
> > > > > While .Read
> > > > > Me.Add(DirectCast(.Item("project_id"), Guid), _
> > > > > DirectCast(.Item("start_date"),
> DateTime),
> > _
> > > > > DirectCast(.Item("end_date"),
DateTime),
> _
> > > > > DirectCast(.Item("priority"),

Integer),
_
> > > > > DirectCast(.Item("description"),
String),
> _
> > > > >

DirectCast(.Item("project_manager"), > > String)
> > > > > End While
> > > > > End With
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Excerpt B:
> > > > > ********
> > > > > With ProjectData
> > > > > While .Read
> > > > > Me.Add(.Item("project_id"),
> > > > > .Item("start_date"),
> > > > > .Item("end_date"),
> > > > > .Item("priority"),
> > > > > .Item("description"),
> > > > > .Item("project_manager")
> > > > > End While
> > > > > End With
> > > > >
> > > > >
> > > > >
> > > > > Question:
> > > > >
> > > > > Does automatic casting outperform explicit casting ? When I run > > ILDASM,
> > > I
> > > > > find
> > > > > that at each DirectCast, there is unboxing but in Excerpt B,

there
> > isn't
> > > > > any.
> > > > >
> > > > > Snippets of the ILDASM for Excerpt A and B below:
> > > > >
> > > > > ILDASM (Excerpt A)
> > > > > ****************
> > > > > IL_0098: ldloc.2
> > > > > IL_0099: ldstr "description"
> > > > > IL_009e: callvirt instance object
> > > > > XXX.Projects.XDataReader::get_Item(string)
> > > > > IL_00a3: unbox [mscorlib]System.Int32
> > > > > IL_00a8: ldobj [mscorlib]System.Int32
> > > > >
> > > > >
> > > > > ILDASM (Excerpt B)
> > > > > ****************
> > > > > IL_0092: ldloc.2
> > > > > IL_0093: ldstr "description"
> > > > > IL_0098: callvirt instance object
> > > > > XXX.Projects.XDataReader::get_Item(string)
> > > > > IL_009d: call int32
> > > > >
> > > >
> > >
> >
>

[Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType ::F
> > > > > romObject(object)
> > > > >
> > > > > Any pointers to articles that explain what goes on "under the hood"
> > with
> > > > > regards to
> > > > > casting would be much appreciated as well.
> > > > >
> > > > > Cheers !
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #11
CJ,
Yeah I remember that. Thats why I was curiuos about that because I read
that value types that exist within a reference type (class) will be created on the heap as well. Only direct value types (if that makes sense) will be created on the stack (like locals and any variables pertinant to the current scope.)
Given:

Public Class Class1
Private m_value As Integer
Private m_object As Object
End Class1

The m_value integer is created on the heap as part of Class1, however the
m_value integer is not a boxed value.

However if I assign m_value to m_object, then m_object will contain a boxed
integer.

m_object = m_value

Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:uo*************@TK2MSFTNGP11.phx.gbl...
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:O7*************@TK2MSFTNGP11.phx.gbl...
CJ,
Alright, so unboxing takes a variable (more than likely on the heap in most
cases)

By definition a boxed value is on the heap.
cases) and creates a copy of that on the heap again on the unboxing

process.
No, not quite. Unboxing creates a copy of that value on the stack.


Ahhh.. ok that makes sense.
And then has to be gc'd as well as the original value (if that original value exists on the heap as well).

Correct the object that was created when the original value was boxed will
need to GC'd...

If you following the above, remember that a regular reference type (a

Class)
can contain value types also, these values can also be boxed & unboxed,
however explaining it is a little more confusing ;-)


Yeah I remember that. Thats why I was curiuos about that because I read
that value types that exist within a reference type (class) will be

created on the heap as well. Only direct value types (if that makes sense) will be created on the stack (like locals and any variables pertinant to the current scope.)
Option Strict has no real effect on Boxing & Unboxing.

I was making a joke. poorly. =)

Thanks again for your help.
Hope this helps
Jay

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:uv****************@TK2MSFTNGP11.phx.gbl...
Ok, last question I swear.

Alright, so unboxing takes a variable (more than likely on the heap in

most
cases) and creates a copy of that on the heap again on the unboxing

process.
And then has to be gc'd as well as the original value (if that original value exists on the heap as well).

Hmmm...

Option Strict. =)

Thanks Jay!

-CJ

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
> CJ,
> > So is unboxing an expensive process? given its only a single line of
IL
> but
> > was curious if it was or not.
> Its expensive in that the value needs to be copied from the heap to

the > variable.
>
> Its also expensive in that the boxing itself created an object on the heap,
> this object will later need to be Garbage collected.
>
> Hope this helps
> Jay
>
> "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> news:%2***************@TK2MSFTNGP10.phx.gbl...
> > Helps tremendously. Thanks for the info on that one Jay.
> >
> > I think the best way to see it "visually" would be when your watching
a
> > variable (in the watch window) of a base type (i.e. DataRow) thats
> actually
> > inherited (i.e MyDataRow of a dataset)
> >
> > Where it shows your +- graphic and says its a datarow, then there is a sub
> > type underneath it that tells the actual class type that it is.
> >
> > I hope that made sense. But again I appreciate your explanation.
> >
> > So is unboxing an expensive process? given its only a single line of
IL
> but
> > was curious if it was or not.
> >
> >
> >
> >
> > "Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in
message
> > news:OL**************@TK2MSFTNGP10.phx.gbl...
> > > CJ,
> > > When you assign a value type to an Object variable that type is

boxed.
> > Which
> > > copies the value of the value type to an object on the heap.
> > >
> > > When you then assign this Object variable back to the value type
> variable,
> > > the object is unboxed.
> > >
> > > Dim i As Integer
> > > i = 100
> > > Dim o As Object
> > > o = i ' this causes the 100 to be boxed.
> > >
> > > i = o ' this causes the boxed 100 to be unboxed
> > >
> > > Of course if you have Option Strict On, you need DirectCast
> > >
> > > i = DirectCast(o, Integer)
> > >
> > > Hope this helps
> > > Jay
> > >
> > > "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> > > news:Op****************@TK2MSFTNGP09.phx.gbl...
> > > > Alright, maybe this is a dumb question, but what is unboxing?
> > > >
> > > >
> > > > "tinman" <dw****@yahoo.com> wrote in message
> > > > news:%2****************@TK2MSFTNGP09.phx.gbl...
> > > > > thanks guys....
> > > > >
> > > > > I believe the Get*Type* works better than the DirectCast

approach.
> The
> > > > > resulting
> > > > > IL appears "leaner"...
> > > > >
> > > > > In the initial IL with DirectCast, I was afraid that all the
> unboxing
> > > > would
> > > > > cause a performance
> > > > > concern since it was going to continue reading data in a

loop (While
> > > > .Read)
> > > > > .......
> > > > >
> > > > > Cheers...
> > > > >
> > > > >
> > > > > "tinman" <dw****@yahoo.com> wrote in message
> > > > > news:uh**************@TK2MSFTNGP12.phx.gbl...
> > > > > > Hi...
> > > > > >
> > > > > > I have the following two excerpts from a method. It

basically > reads
> > > data
> > > > > > from a DataReader and
> > > > > > loads it in a collection.
> > > > > >
> > > > > >
> > > > > > Excerpt A:
> > > > > > ********
> > > > > > With ProjectData
> > > > > > While .Read
> > > > > > Me.Add(DirectCast(.Item("project_id"), Guid), _ > > > > > > DirectCast(.Item("start_date"),
> > DateTime),
> > > _
> > > > > > DirectCast(.Item("end_date"),
> DateTime),
> > _
> > > > > > DirectCast(.Item("priority"),
Integer),
> _
> > > > > > DirectCast(.Item("description"), > String),
> > _
> > > > > >

DirectCast(.Item("project_manager"),
> > > String)
> > > > > > End While
> > > > > > End With
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Excerpt B:
> > > > > > ********
> > > > > > With ProjectData
> > > > > > While .Read
> > > > > > Me.Add(.Item("project_id"),
> > > > > > .Item("start_date"),
> > > > > > .Item("end_date"),
> > > > > > .Item("priority"),
> > > > > > .Item("description"),
> > > > > > .Item("project_manager")
> > > > > > End While
> > > > > > End With
> > > > > >
> > > > > >
> > > > > >
> > > > > > Question:
> > > > > >
> > > > > > Does automatic casting outperform explicit casting ? When I run
> > > ILDASM,
> > > > I
> > > > > > find
> > > > > > that at each DirectCast, there is unboxing but in Excerpt
B, there
> > > isn't
> > > > > > any.
> > > > > >
> > > > > > Snippets of the ILDASM for Excerpt A and B below:
> > > > > >
> > > > > > ILDASM (Excerpt A)
> > > > > > ****************
> > > > > > IL_0098: ldloc.2
> > > > > > IL_0099: ldstr "description"
> > > > > > IL_009e: callvirt instance object
> > > > > > XXX.Projects.XDataReader::get_Item(string)
> > > > > > IL_00a3: unbox [mscorlib]System.Int32
> > > > > > IL_00a8: ldobj [mscorlib]System.Int32
> > > > > >
> > > > > >
> > > > > > ILDASM (Excerpt B)
> > > > > > ****************
> > > > > > IL_0092: ldloc.2
> > > > > > IL_0093: ldstr "description"
> > > > > > IL_0098: callvirt instance object
> > > > > > XXX.Projects.XDataReader::get_Item(string)
> > > > > > IL_009d: call int32
> > > > > >
> > > > >
> > > >
> > >
> >
>

[Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.IntegerType ::F
> > > > > > romObject(object)
> > > > > >
> > > > > > Any pointers to articles that explain what goes on "under the > hood"
> > > with
> > > > > > regards to
> > > > > > casting would be much appreciated as well.
> > > > > >
> > > > > > Cheers !
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: william | last post by:
Hi, everyone After adding a control into a container like form using form.controls.add(myControl), how could I reference it For example dim aControl as new butto me.controls.add(aControl ...
24
by: Brad Marts | last post by:
I would like to have a function that takes as an argument a base class but performs differently depending on which type of derived class is passed. Can I tell which derived class is passed? For...
17
by: lawrence | last post by:
How is it possible that the question "How do I detect which browser the user has" is missing from this FAQ: http://www.faqts.com/knowledge_base/index.phtml/fid/125 and is only here on this...
14
by: J.S. | last post by:
In a Windows Form application, which is the better method to concatenate large blocks of code? 1. Reading the text from text files. 2. Adding the text to the VB file itself? Thanks! J.S. ...
34
by: Jeff | last post by:
For years I have been using VBA extensively for updating data to tables after processing. By this I mean if I had to do some intensive processing that resulted in data in temp tables, I would have...
15
by: Rob Meade | last post by:
Hi all, I have a databse which I'm pulling the data from for my ASP page. I have 4 tables, Course, Feature, Objective, and PreRequisite. The last three all contain a course product code and a...
2
by: rn5a | last post by:
A Form has a select list which is populated from a MS-Access database table. The DB table from where the select list is populated has 2 columns - CountryID & CountryName. When the Form is posted,...
20
by: mike3 | last post by:
Hi. (Xposted to both comp.lang.c++ and comp.programming since I've got questions related to both C++ language and general programming) I've got the following C++ code. The first routine runs in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.