473,387 Members | 1,476 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,387 software developers and data experts.

Need help with calling one class from another

I've got an app with two classes, and one class (InventoryInfoClass)
is an object within the other class (InventoryItem). I'm running into
problems with trying to access (get/set) a private variable within the
included class (InventoryInfo) from the "including" class
(InventoryItem).

Here's the code, trimmed down. I've included ********* at the start
of the first line that's blowing up on me. I'm sure others that try
to access the invInfo.companyName field will blow up too.

Any help please?

------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace InventoryInfo
{
public class InventoryInfoClass
{
private string _companyName;
public InventoryInfoClass()
{
companyName = "";

}

public string companyName
{
get
{
return _companyName;
}
set
{
_companyName = value;
}
}

}

public class InventoryItem
{
private InventoryInfoClass invInfo;
private string _itemID;

public InventoryItem()
{
InventoryInfoClass invInfo = new InventoryInfoClass();
_itemID = "";

}

public string itemID
{
get
{
return _itemID;
}
set
{
_itemID = value;
}

}
public string companyName
{
get
{
********* return invInfo.companyName;
}

set
{
invInfo.companyName = value;
}
}
public void printInvItem()
{

Console.WriteLine("Company Name: {0}", this.companyName);
Console.WriteLine("Item ID: {0}", this.itemID);

Console.WriteLine("Press any key to continue");
Console.ReadLine();

}

}
class InvApp
{
static void Main(string[] args)
{
InventoryItem invItem = new InventoryItem();

invItem.printInvItem();

invItem.companyName = "C";

invItem.printInvItem();
}

}

}


Jul 21 '08 #1
20 1444
I am feeling that every InventoryItem have an InventoryInfoClass, (or
in other words, every InventoryItem object have a company name) its
means InventoryInfoClass can be a base class for all items.

So you should change your model and inherit InventoryItem from
InventoryInfoClass, then all the private members of InventoryInfoClass
will be accessible in InventoryItem.
Ali
On Jul 21, 9:22*am, "d.s." <nodamnspa...@yahoo.comwrote:
I've got an app with two classes, and one class (InventoryInfoClass)
is an object within the other class (InventoryItem). *I'm running into
problems with trying to access (get/set) a private variable within the
included class (InventoryInfo) *from the "including" class
(InventoryItem).

Here's the code, trimmed down. *I've included ********* at the start
of the first line that's blowing up on me. *I'm sure others that try
to access the invInfo.companyName field will blow up too.

Any help please?

------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace InventoryInfo
{
* * public class InventoryInfoClass
* * {
* * * * private string _companyName;

* * * * public InventoryInfoClass()
* * * * {
* * * * * * companyName = "";

* * * * }

* * * * public string companyName
* * * * {
* * * * * * get
* * * * * * {
* * * * * * * * return _companyName;
* * * * * * }
* * * * * * set
* * * * * * {
* * * * * * * * _companyName = value;
* * * * * * }
* * * * }

* * }

* * public class InventoryItem
* * {
* * * * private InventoryInfoClass invInfo;
* * * * private string _itemID;

* * * * public InventoryItem()
* * * * {
* * * * * * InventoryInfoClass invInfo = new InventoryInfoClass();
* * * * * * _itemID = "";

* * * * }

* * * * public string itemID
* * * * {
* * * * * * get
* * * * * * {
* * * * * * * * return _itemID;
* * * * * * }
* * * * * * set
* * * * * * {
* * * * * * * * _itemID = value;
* * * * * * }

* * * * }

* * * * public string companyName
* * * * {
* * * * * * get
* * * * * * {
********* * * * return invInfo.companyName;
* * * * * * }

* * * * * * set
* * * * * * {
* * * * * * * * invInfo.companyName = value;
* * * * * * }
* * * * }

* * * * public void printInvItem()
* * * * {

* * * * * * Console.WriteLine("Company Name: {0}", this.companyName);
* * * * * * Console.WriteLine("Item ID: {0}", this.itemID);

* * * * * * Console.WriteLine("Press any key to continue");
* * * * * * Console.ReadLine();

* * * * }

* * }

* * class InvApp
* * {
* * * * static void Main(string[] args)
* * * * {
* * * * * * InventoryItem invItem = new InventoryItem();

* * * * * * invItem.printInvItem();

* * * * * * invItem.companyName = "C";

* * * * * * invItem.printInvItem();
* * * * }

* * }

}
Jul 21 '08 #2
On Sun, 20 Jul 2008 21:22:38 -0700, d.s. <no**********@yahoo.comwrote:
I've got an app with two classes, and one class (InventoryInfoClass)
is an object within the other class (InventoryItem). I'm running into
problems with trying to access (get/set) a private variable within the
included class (InventoryInfo) from the "including" class
(InventoryItem).
First, the code you posted should work. The line you say doesn't work
isn't accessing the private field, but rather a public property. Can we
assume that the code you posted isn't in fact the code that you're having
trouble with?

I admit, from the code you posted, it's not obvious to me why you have the
nested class anyway. The outer, containing class is just proxying the
value to the nested class anyway. Why not just put that data in the
containing class?

That said, the issue you're seeing is a basic rule about nested classes:
the nested class can see "private" members of the containing class, but
not the other way around. That is, since the nested class is effectively
a member the containing class, it has access to everything _any_ member of
the containing class would, including all private members of the
containing class. But the containing class is most certainly not a member
of the nested class, and only the members of the nested class can access
private members.

Personally, I don't see the problem here. I don't know why you want the
nested class in the first place, but assuming you do, why not just use the
public property as you've defined it, rather than trying to get at the
private field? That's a better encapsulation anyway.

If you can elaborate on what code is actually not working, and why it is
you think your containing class should have access to private members of
the nested class, perhaps we can offer different advice more suitable to
your goals (assuming the above doesn't do it).

Pete
Jul 21 '08 #3
d.s. wrote:
I've got an app with two classes, and one class (InventoryInfoClass)
is an object within the other class (InventoryItem). I'm running into
problems with trying to access (get/set) a private variable within the
included class (InventoryInfo) from the "including" class
(InventoryItem).

Here's the code, trimmed down. I've included ********* at the start
of the first line that's blowing up on me. I'm sure others that try
to access the invInfo.companyName field will blow up too.

Any help please?
8< snip
>
public class InventoryItem
{
private InventoryInfoClass invInfo;
private string _itemID;

public InventoryItem()
{
InventoryInfoClass invInfo = new InventoryInfoClass();
Here you have declared a local variable with the same name as the member
variable. The local variable gets assigned the new info object, but the
member variable remains null.
_itemID = "";

}
8< snip

--
Göran Andersson
_____
http://www.guffa.com
Jul 21 '08 #4
On Jul 20, 11:49*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sun, 20 Jul 2008 21:22:38 -0700, d.s. <nodamnspa...@yahoo.comwrote:
I've got an app with two classes, and one class (InventoryInfoClass)
is an object within the other class (InventoryItem). *I'm running into
problems with trying to access (get/set) a private variable within the
included class (InventoryInfo) *from the "including" class
(InventoryItem).

First, the code you posted should work. *The line you say doesn't work *
isn't accessing the private field, but rather a public property. *Can we *
assume that the code you posted isn't in fact the code that you're having*
trouble with?

I agree it should work, but it is bombin on me. It is the code, but
it's trimmed way down, getting rid of other variables and their
accessors.
>
I admit, from the code you posted, it's not obvious to me why you have the *
nested class anyway. *The outer, containing class is just proxying the *
value to the nested class anyway. *Why not just put that data in the *
containing class?
Ths was a homework assignment. It has already been submitted, so
you're not doing my work for me. But I need to understand what went
wrong because other assignments will build on this. The teacher seems
to be having a bit of a problem responding to requests for help
(online class).

So, the assignment was to do it as done here. The next assignment was
to inherit the InventoryInfo class, which worked with no problems.
That said, the issue you're seeing is a basic rule about nested classes: *
the nested class can see "private" members of the containing class, but *
not the other way around. *That is, since the nested class is effectively *
a member the containing class, it has access to everything _any_ member of *
the containing class would, including all private members of the *
containing class. *But the containing class is most certainly not a member *
of the nested class, and only the members of the nested class can access *
private members.
But it should be able to use the accessors to gain access to the
private variables. Perhaps my terminology is wrong. I'm trying to
use the accessor, and it's blowing up:

********* return invInfo.companyName;
>
Personally, I don't see the problem here. *I don't know why you want the *
nested class in the first place, but assuming you do, why not just use the *
public property as you've defined it, rather than trying to get at the *
private field? *That's a better encapsulation anyway.
I am trying to use the accessor to gain access to the private field.

********* return invInfo.companyName;

but it doesn't like it.
>
If you can elaborate on what code is actually not working, and why it is *
you think your containing class should have access to private members of *
the nested class, perhaps we can offer different advice more suitable to *
your goals (assuming the above doesn't do it).
The line I put the asterisks on is the first line that bombs in my
compiler.

If the contained class is to access the elements of the container
class, this means I will need to change the contained class everytime
I want to include it into a different container class that has
different elements.
Jul 21 '08 #5
d.s. wrote:
>First, the code you posted should work. The line you say doesn't work
isn't accessing the private field, but rather a public property. Can we
assume that the code you posted isn't in fact the code that you're having
trouble with?


I agree it should work, but it is bombin on me.
No, it should not work. Se my other post in the thread.
>If you can elaborate on what code is actually not working, and why it is
you think your containing class should have access to private members of
the nested class, perhaps we can offer different advice more suitable to
your goals (assuming the above doesn't do it).

The line I put the asterisks on is the first line that bombs in my
compiler.
Are you completely sure about that? It compiles just fine for me, but I
get a runtime exception on exactly that line because the invInfo member
variable is null.

--
Göran Andersson
_____
http://www.guffa.com
Jul 21 '08 #6
On Jul 21, 3:01 am, Göran Andersson <gu...@guffa.comwrote:
d.s. wrote:
First, the code you posted should work. The line you say doesn't work
isn't accessing the private field, but rather a public property. Can we
assume that the code you posted isn't in fact the code that you're having
trouble with?
I agree it should work, but it is bombin on me.

No, it should not work. Se my other post in the thread.
If you can elaborate on what code is actually not working, and why it is
you think your containing class should have access to private members of
the nested class, perhaps we can offer different advice more suitable to
your goals (assuming the above doesn't do it).
The line I put the asterisks on is the first line that bombs in my
compiler.

Are you completely sure about that? It compiles just fine for me, but I
get a runtime exception on exactly that line because the invInfo member
variable is null.

--
Göran Andersson
_____http://www.guffa.com
I'll check that out. The error message I got back was not very
helpful. Yes, it did compile for me. It was a runtime error.
Thanks. I'll check it.
Jul 21 '08 #7
On Mon, 21 Jul 2008 02:27:14 -0700, d.s. <no**********@yahoo.comwrote:
I agree it should work, but it is bombin on me. It is the code, but
it's trimmed way down, getting rid of other variables and their
accessors. [...]
Ah, I see where I misread. Your use of the word "including" misdirected
me and I incorrectly read the "Info" class as being nested.

Also, next time you post a question, please avoid vague terms like "blow
up" and "bombin [sic] on me". It doesn't help that one post claims it was
a compiler error, but more broadly you simply need to post a precise
description of the error.

I apologize for any confusion...as is sometimes the case, trying to answer
questions very late at night caused me to overlook pretty much all of the
important parts of the code, relying too much on your description of the
problem.

Anyway, Göran has the answer for you. You should read his post.

Pete
Jul 21 '08 #8
On Jul 21, 3:01*am, Göran Andersson <gu...@guffa.comwrote:
d.s. wrote:
First, the code you posted should work. *The line you say doesn't work *
isn't accessing the private field, but rather a public property. *Can we *
assume that the code you posted isn't in fact the code that you're having *
trouble with?
I agree it should work, but it is bombin on me.

No, it should not work. Se my other post in the thread.
If you can elaborate on what code is actually not working, and why it is *
you think your containing class should have access to private members of *
the nested class, perhaps we can offer different advice more suitable to *
your goals (assuming the above doesn't do it).
The line I put the asterisks on is the first line that bombs in my
compiler.

Are you completely sure about that? It compiles just fine for me, but I
get a runtime exception on exactly that line because the invInfo member
variable is null.

--
Göran Andersson
_____http://www.guffa.com
I set the invInfo member variable to non-null. And not it blows up on
the set accessor when I try to change it. Also, when I hover over
invInfo on that line, it shows NULL.
Jul 21 '08 #9
On Jul 21, 8:38*am, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Mon, 21 Jul 2008 02:27:14 -0700, d.s. <nodamnspa...@yahoo.comwrote:
I agree it should work, but it is bombin on me. *It is the code, but
it's trimmed way down, getting rid of other variables and their
accessors. *[...]

Ah, I see where I misread. *Your use of the word "including" misdirected *
me and I incorrectly read the "Info" class as being nested.

Also, next time you post a question, please avoid vague terms like "blow *
up" and "bombin [sic] on me". *It doesn't help that one post claims it was *
a compiler error, but more broadly you simply need to post a precise *
description of the error.
Sorry. I was at home, without the code in front of me, and was just
posting from memory.
>
I apologize for any confusion...as is sometimes the case, trying to answer *
questions very late at night caused me to overlook pretty much all of the*
important parts of the code, relying too much on your description of the *
problem.
You also have a novice over here, to c# anyway.
Jul 21 '08 #10
On Mon, 21 Jul 2008 08:55:32 -0700, d.s. <no**********@yahoo.comwrote:
[...]
You also have a novice over here, to c# anyway.
Being a novice doesn't prevent you from being precise about your errors.
I see that you have once again described your error in an imprecise way.
I'll once again recommend that you describe it precisely.

And of course, since you've changed the code, you should post actual
_code_ that illustrates your change. We can make assumptions about what
you changed, but there are lots of ways to do it wrong and only one way to
do it right. If it's not working, undoubtedly you didn't do it right,
which leaves a great number of possible alternatives from which we have to
guess about.

Pete
Jul 21 '08 #11
On Jul 21, 8:38*am, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Mon, 21 Jul 2008 02:27:14 -0700, d.s. <nodamnspa...@yahoo.comwrote:
I agree it should work, but it is bombin on me. *It is the code, but
it's trimmed way down, getting rid of other variables and their
accessors. *[...]

Ah, I see where I misread. *Your use of the word "including" misdirected *
me and I incorrectly read the "Info" class as being nested.

Also, next time you post a question, please avoid vague terms like "blow *
up" and "bombin [sic] on me". *It doesn't help that one post claims it was *
a compiler error, but more broadly you simply need to post a precise *
description of the error.
Ok, I just compiled and ran the code here at work.

It gives me a run-time error on that line with a message of "Object
reference not set to an instance of an object." If I hover over
invInfo, it shows NULL.

So, within that accessor, it can't see the instance of invInfo that I
created in the constructor.

I tried changing the scope (or whatever you call it) of invInfo from
private to protected. Same problem. I set the companyName to "test"
in the constructor. Same problem.

I'm using VS 2008 on this. It's a console app.

I'm going to reread Goran's post, to make sure I got it all.
Jul 21 '08 #12
On Jul 21, 12:42*am, Göran Andersson <gu...@guffa.comwrote:
d.s. wrote:
I've got an app with two classes, and one class (InventoryInfoClass)
is an object within the other class (InventoryItem). *I'm running into
problems with trying to access (get/set) a private variable within the
included class (InventoryInfo) *from the "including" class
(InventoryItem).
Here's the code, trimmed down. *I've included ********* at the start
of the first line that's blowing up on me. *I'm sure others that try
to access the invInfo.companyName field will blow up too.
Any help please?

8< snip
* * public class InventoryItem
* * {
* * * * private InventoryInfoClass invInfo;
* * * * private string _itemID;
* * * * public InventoryItem()
* * * * {
* * * * * * InventoryInfoClass invInfo = new InventoryInfoClass();

Here you have declared a local variable with the same name as the member
variable. The local variable gets assigned the new info object, but the
member variable remains null.
Ok, I'm a little vague on this. Not that you're vague. I'm just not
sure how to set this up. I thought by doing the following, I was
setting up a local variable:
public class InventoryItem
{
>>>>public InventoryInfoClass invInfo;
private string _itemID;

Jul 21 '08 #13
On Jul 21, 9:15*am, "d.s." <nodamnspa...@yahoo.comwrote:
On Jul 21, 12:42*am, Göran Andersson <gu...@guffa.comwrote:


d.s. wrote:
I've got an app with two classes, and one class (InventoryInfoClass)
is an object within the other class (InventoryItem). *I'm running into
problems with trying to access (get/set) a private variable within the
included class (InventoryInfo) *from the "including" class
(InventoryItem).
Here's the code, trimmed down. *I've included ********* at the start
of the first line that's blowing up on me. *I'm sure others that try
to access the invInfo.companyName field will blow up too.
Any help please?
8< snip
* * public class InventoryItem
* * {
* * * * private InventoryInfoClass invInfo;
* * * * private string _itemID;
* * * * public InventoryItem()
* * * * {
* * * * * * InventoryInfoClass invInfo = new InventoryInfoClass();
Here you have declared a local variable with the same name as the member
variable. The local variable gets assigned the new info object, but the
member variable remains null.

Ok, I'm a little vague on this. *Not that you're vague. *I'm just not
sure how to set this up. *I thought by doing the following, I was
setting up a local variable:

*public class InventoryItem
* * {>>>>public InventoryInfoClass invInfo;

* * * * private string _itemID;- Hide quoted text -

- Show quoted text -
I'm stepping through this code, and, in the constructor, I can see the
instance of invInfo populated. When I leave the constructor, invInfo
is null. I thought the constructor creates a persisting instance.
Jul 21 '08 #14
On Mon, 21 Jul 2008 09:11:55 -0700, d.s. <no**********@yahoo.comwrote:
Ok, I just compiled and ran the code here at work.

It gives me a run-time error on that line with a message of "Object
reference not set to an instance of an object." If I hover over
invInfo, it shows NULL.
Then it's still null (not "NULL"...that's a Windows constant).

But you still didn't post the code you changed. You claimed to have fixed
the assignment to a local variable in the constructor, but based on your
most recent description I'd say you almost certainly didn't.
So, within that accessor, it can't see the instance of invInfo that I
created in the constructor.
Well, as Göran pointed out, you never assigned the instance you created in
the constructor to that field. You assigned it to a local variable only,
so the instance just gets thrown away when the constructor returns to the
caller.
I tried changing the scope (or whatever you call it)
"Accessibility". "Scope" is something else.
of invInfo from private to protected. Same problem.
Of course. Accessibility is a compile-time issue. You're getting a
run-time error. Changing accessibility isn't going to affect that.
I set the companyName to "test"
in the constructor. Same problem.
Of course. You're still changing the property on an instance that isn't
being saved to your field.

I believe that if you simply change "InventoryInfoClass invInfo = new
InventoryInfoClass();" in your constructor to read "invInfo = new
InventoryInfoClass();", that will fix your problem. There are better ways
to write the code IMHO, but that's the smallest change that should address
the run-time error you're reporting.

Pete
Jul 21 '08 #15
On Mon, 21 Jul 2008 09:27:30 -0700, d.s. <no**********@yahoo.comwrote:
I'm stepping through this code, and, in the constructor, I can see the
instance of invInfo populated. When I leave the constructor, invInfo
is null. I thought the constructor creates a persisting instance.
The constructor is just another method. It doesn't have any magic to
cause an instance to persist unless you copy the reference to that
instance somewhere that will make it persist.
Jul 21 '08 #16
On Jul 21, 9:33*am, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Mon, 21 Jul 2008 09:27:30 -0700, d.s. <nodamnspa...@yahoo.comwrote:
I'm stepping through this code, and, in the constructor, I can see the
instance of invInfo populated. *When I leave the constructor, invInfo
is null. *I thought the constructor creates a persisting instance.

The constructor is just another method. *It doesn't have any magic to *
cause an instance to persist unless you copy the reference to that *
instance somewhere that will make it persist.
That worked. Thanks Peter, and Goran, and all. I thought I would
have needed to cast or define that variable before I assigned an
object to it.

I'm not new to programming, but I am new to conceptualizing all the
ins and outs of scoping and instantiation in object oriented
programming. It doesn't always stick very well in the wetware.

Thanks again.
Jul 21 '08 #17
On Mon, 21 Jul 2008 09:48:12 -0700, d.s. <no**********@yahoo.comwrote:
That worked. Thanks Peter, and Goran, and all. I thought I would
have needed to cast or define that variable before I assigned an
object to it.
Casting, no. Define a variable, yes. But you already did, as the
instance field from which you try to retrieve it later. The local
variable was superfluous.

Glad it worked out. :)
Jul 21 '08 #18
On Jul 21, 9:54*am, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Mon, 21 Jul 2008 09:48:12 -0700, d.s. <nodamnspa...@yahoo.comwrote:
That worked. *Thanks Peter, and Goran, and all. *I thought I would
have needed to cast or define that variable before I assigned an
object to it.

Casting, no. *Define a variable, yes. *But you already did, as the *
instance field from which you try to retrieve it later. *The local *
variable was superfluous.

Glad it worked out. *:)
Ok, I think I got it. I inadvertently created a separate instance of
invInfo within the constructor, which only had scope within the
constructor, rather than referencing the class variable.

Is that it?

Thanks.

Jul 21 '08 #19
On Mon, 21 Jul 2008 10:59:56 -0700, d.s. <no**********@yahoo.comwrote:
Ok, I think I got it. I inadvertently created a separate instance of
invInfo within the constructor, which only had scope within the
constructor, rather than referencing the class variable.

Is that it?
Almost. You didn't create "a separate instance", you created "a separate
_variable_".

You only ever create one instance; the instance itself isn't the problem.
It's where you copy the reference of the instance to after you create it
that was the issue.

Other than that, yes...your statement is an accurate description of the
mistake.

Pete
Jul 21 '08 #20
d.s. wrote:
Ok, I'm a little vague on this. Not that you're vague. I'm just not
sure how to set this up. I thought by doing the following, I was
setting up a local variable:
public class InventoryItem
{
>>>>public InventoryInfoClass invInfo;
private string _itemID;
No, that's a member variable. It's scope is the class.

A local variable is a variable declared inside a method, and it has the
scope of that method.

You dceclared a local variable in the constructor with the same name as
the member variable. You created an instance of the class (using the new
keyword), and assigned it's reference to the local variable.

When the constructor code ends, the local variable goes away, and with
it the reference to the instance that you created.

As you want to access the member variable, you should not create the
local variable at all.

Change this:

InventoryInfoClass invInfo = new InventoryInfoClass();

to:

invInfo = new InventoryInfoClass();

--
Göran Andersson
_____
http://www.guffa.com
Jul 21 '08 #21

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

Similar topics

31
by: jfj | last post by:
I don't understand. We can take a function and attach it to an object, and then call it as an instance method as long as it has at least one argument: ############# class A: pass def...
2
by: Aaron | last post by:
I have a data sructure setup and I populate it in a loop like so: y=0 while X: DS.name = "ASDF" DS.ID = 1234 list = DS; y = y + 1
9
by: Player | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello all. I am in the process of teaching myself C# and I think I am doing OK. I have learnt how to how to call the right constructor of a...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
18
by: bsruth | last post by:
I tried for an hour to find some reference to concrete information on why this particular inheritance implementation is a bad idea, but couldn't. So I'm sorry if this has been answered before....
2
by: rn5a | last post by:
This function in a VB class file takes UserID as a parameter & returns a SqlDataReader to the calling function which exists in a ASPX page: Namespace NConnect Public Class Cart Private sqlConn...
15
by: Jess | last post by:
Hello, Sometimes declarations are all what we need when we define/declare classes (or functions?), but sometimes we need definitions. I learned that if we define a class (B) that has an object...
5
by: bean330 | last post by:
Hey, I'm somewhat new to C# and I need a little help, please! I'm selecting a bunch of records, setting properties on a COM executable and then calling a method on that executable to run. I...
0
by: akshaycjoshi | last post by:
I am reading a book which says Even though unboxed value types don't have a type object pointer, you can still call virtual methods (such as Equals, GetHashCode, or ToString) inherited or...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.